/**
 * HS Assist - Modern B2B CSS Stylesheet
 */

:root {
    --primary: #1a4d3e;
    --primary-hover: #13392e;
    --primary-light: #eef7f4;
    --primary-border: #cce5dc;
    --accent: #2e7d32;
    --danger: #d32f2f;
    --danger-bg: #ffebee;
    --warning: #ef6c00;
    --warning-bg: #fff3e0;
    --info: #0288d1;
    --info-bg: #e1f5fe;
    --text-main: #2c3e50;
    --text-muted: #64748b;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.gus-lookup-btn {
    margin-top: 10px;
    width: 100%;
}

.gus-result {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: var(--border-radius);
    font-size: 14px;
    line-height: 1.5;
}

.gus-result-loading {
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.gus-result-success {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.gus-result-error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-page);
    line-height: 1.5;
    font-size: 15px;
}

/* ======================================================
   WIZARD LAYOUT
   ====================================================== */
.wizard-body {
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 10% 0%, rgba(26, 77, 62, 0.08), transparent 32rem),
        linear-gradient(180deg, #f8fbfa 0%, #f5f7fa 46%, #f8fafc 100%);
}

.wizard-wrapper {
    width: 100%;
    min-width: 0;
    max-width: 1040px;
    margin: 0 auto;
    padding: 28px 32px 46px;
}

.wizard-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding: 0 4px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    font-size: 27px;
    background: #fff;
    border: 1px solid rgba(26, 77, 62, 0.12);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.brand-title {
    font-size: 26px;
    font-weight: 750;
    color: var(--primary);
    line-height: 1.1;
}

.brand-subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.admin-login-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid var(--primary-border);
    background: white;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.admin-login-link:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.admin-link-short {
    display: none;
}

/* ======================================================
   PROGRESS BAR
   ====================================================== */
.wizard-progress-container {
    background: rgba(255, 255, 255, 0.94);
    padding: 20px 24px 16px;
    border-radius: 16px;
    border: 1px solid rgba(203, 213, 225, 0.9);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.055);
    margin-bottom: 24px;
    overflow: hidden;
}

.wizard-progress-bar {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    position: relative;
}

.progress-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    min-width: 0;
}

.progress-node::before {
    content: '';
    position: absolute;
    top: 18px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: #dbe4ec;
    z-index: -1;
}

.progress-node:first-child::before {
    display: none;
}

.node-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 9px;
    border: 4px solid #fff;
    box-shadow: 0 0 0 1px #dbe4ec;
    transition: all 0.3s;
}

.node-label {
    width: 100%;
    max-width: 104px;
    min-height: 30px;
    padding: 0 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.progress-node.current .node-circle {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(26, 77, 62, 0.14);
}

.progress-node.current .node-label {
    color: var(--primary);
    font-weight: 700;
}

.progress-node.completed .node-circle {
    background: var(--accent);
    color: white;
}

.progress-mobile-summary {
    display: none;
}

.progress-node.completed::before {
    background: var(--accent);
}

/* ======================================================
   STEP CARD & FORMS
   ====================================================== */
.step-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 18px;
    border: 1px solid rgba(203, 213, 225, 0.86);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
    padding: 36px 42px;
}

.step-header {
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid #e7edf2;
}

.step-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
    border: 1px solid var(--primary-border);
}

.step-header h2 {
    font-size: clamp(23px, 3vw, 30px);
    letter-spacing: -0.025em;
    color: var(--primary);
    margin-bottom: 6px;
}

.step-lead {
    color: var(--text-muted);
    max-width: 760px;
    font-size: 15px;
    line-height: 1.65;
}

.required {
    color: var(--danger);
    font-weight: bold;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 22px;
    margin-bottom: 8px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background-color: #fff;
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 77, 62, 0.15);
}

.field-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-section {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
    border: 1px solid #e1e9e6;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.025);
}

.form-section-title {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8efec;
}

/* Radio Type Cards */
.type-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.type-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
}

.type-card:hover {
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.type-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.type-card input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.type-icon {
    font-size: 26px;
}

.type-title {
    display: block;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 2px;
}

.type-desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

/* ======================================================
   BUTTONS & ACTIONS
   ====================================================== */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 15px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-success {
    background: var(--accent);
    color: white;
}

.btn-success:hover {
    background: #256529;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b71c1c;
}

.btn-outline {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

/* ======================================================
   ALERTS & NOTICES
   ====================================================== */
.alert {
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-danger {
    background: var(--danger-bg);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.info-alert {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid var(--accent);
    padding: 14px 18px;
    border-radius: 4px;
    font-size: 13px;
    color: #166534;
}

/* ======================================================
   UPLOAD DROPZONE
   ====================================================== */
.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s;
}

.upload-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.dropzone-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.dropzone-limits {
    font-size: 12px;
    color: var(--text-muted);
    margin: 8px 0 15px 0;
}

.file-input {
    display: none;
}

.file-list-preview {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f1f5f9;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
}

.file-status-ready {
    color: #2e7d32;
}

.file-status-error {
    color: #d32f2f;
}

/* ======================================================
   CAPTCHA BOX
   ====================================================== */
.captcha-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
}

.captcha-question-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.captcha-icon {
    font-size: 32px;
}

.captcha-question {
    display: block;
    font-size: 18px;
    color: var(--primary);
}

/* ======================================================
   SUMMARY CARDS
   ====================================================== */
.summary-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.summary-item {
    background: #fdfdfd;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px 20px;
}

.summary-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.summary-item-header h4 {
    font-size: 14px;
    color: var(--primary);
}

.summary-edit-link {
    font-size: 12px;
    color: var(--info);
    text-decoration: none;
    font-weight: 600;
}

.summary-edit-link:hover {
    text-decoration: underline;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    font-size: 13px;
}

.summary-text-box {
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    max-height: 180px;
    overflow-y: auto;
}

/* ======================================================
   SUCCESS SCREEN
   ====================================================== */
.success-card {
    text-align: center;
    padding: 45px 30px;
}

.success-icon-badge {
    font-size: 54px;
    margin-bottom: 15px;
}

.success-lead {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 550px;
    margin: 10px auto 25px;
}

.ticket-number-box {
    background: var(--primary-light);
    border: 2px dashed var(--primary-border);
    padding: 20px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 25px;
}

.ticket-number-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ticket-number-value {
    font-size: 28px;
    color: var(--primary);
    letter-spacing: 1px;
}

.success-info-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 6px;
    max-width: 600px;
    margin: 0 auto 25px;
    text-align: left;
    font-size: 14px;
}

.direct-link-box {
    max-width: 600px;
    margin: 0 auto 30px;
    text-align: left;
}

.copy-input-group {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* ======================================================
   TICKET HERO & CONVERSATION THREAD
   ====================================================== */
.ticket-hero-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px 30px;
    box-shadow: var(--shadow-sm);
}

.ticket-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.ticket-category-tag {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.ticket-hero-title {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 4px;
}

.ticket-hero-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.ticket-hero-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.status-badge-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-label {
    font-size: 12px;
    color: var(--text-muted);
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
}

.badge-new { background: #dbeafe; color: #1e40af; }
.badge-in-progress { background: #fef3c7; color: #92400e; }
.badge-waiting { background: #ffedd5; color: #9a3412; }
.badge-closed { background: #f1f5f9; color: #475569; }
.badge-verified { background: #dcfce7; color: #166534; }
.badge-unverified { background: #fee2e2; color: #991b1b; }

.ticket-details-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 30px;
    font-size: 13px;
}

.conversation-section {
    margin-top: 30px;
}

.section-title {
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 15px;
}

.messages-thread {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-bubble {
    border-radius: 8px;
    padding: 18px 22px;
    border: 1px solid var(--border-color);
    background: white;
    box-shadow: var(--shadow-sm);
}

.customer-bubble {
    border-left: 4px solid var(--info);
}

.admin-bubble {
    border-left: 4px solid var(--primary);
    background: #fbfdfc;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
}

.message-author {
    color: #1e293b;
    font-size: 14px;
}

.message-date {
    color: var(--text-muted);
}

.message-body {
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
}

.message-attachments {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.attachments-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attachment-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #1e293b;
    text-decoration: none;
    border: 1px solid #cbd5e1;
    transition: all 0.2s;
}

.attachment-pill:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.att-ext {
    font-weight: bold;
    color: var(--primary);
}

.reply-section {
    margin-top: 30px;
}

.reply-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
}

.reply-card h3 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 15px;
}

.replies-locked-notice {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 20px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.locked-icon {
    font-size: 24px;
}

.replies-locked-notice h4 {
    color: #92400e;
    font-size: 15px;
}

.replies-locked-notice p {
    color: #b45309;
    font-size: 13px;
}

.wizard-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 30px;
    padding: 24px 16px 6px;
    border-top: 1px solid rgba(148, 163, 184, 0.28);
    line-height: 1.6;
}

.footer-company-line {
    display: flex;
    justify-content: center;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--primary);
    white-space: nowrap;
    font-size: clamp(8px, 1.35vw, 13px);
    overflow-x: auto;
    scrollbar-width: thin;
}

.footer-company-line strong {
    font-size: 1.08em;
    letter-spacing: 0.035em;
}

.footer-company-line span {
    font-weight: 600;
}

.footer-company-line .footer-separator {
    color: #94a3b8;
}

.footer-admin-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.footer-admin-row .admin-login-link {
    padding: 7px 11px;
    font-size: 12px;
    box-shadow: none;
    opacity: 0.82;
}

.footer-admin-row .admin-login-link:hover {
    opacity: 1;
}

/* ======================================================
   RESPONSIVENESS
   ====================================================== */
@media (max-width: 900px) {
    .wizard-wrapper {
        padding-left: 20px;
        padding-right: 20px;
    }

    .wizard-progress-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .node-label {
        font-size: 10px;
    }

    .step-card {
        padding: 32px 30px;
    }
}

@media (max-width: 768px) {
    .wizard-wrapper {
        padding: 0 12px 30px;
        margin: 15px auto;
    }

    .wizard-top-header {
        margin-bottom: 16px;
        padding: 0 2px 16px;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 23px;
    }

    .brand-title {
        font-size: 21px;
    }

    .brand-subtitle {
        font-size: 11px;
    }

    .admin-login-link {
        padding: 8px 10px;
        font-size: 12px;
    }

    .wizard-progress-container {
        padding: 14px 14px 13px;
        border-radius: 14px;
        margin-bottom: 16px;
    }

    .progress-mobile-summary {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
        color: var(--text-muted);
        font-size: 12px;
    }

    .progress-mobile-summary strong {
        color: var(--primary);
        font-size: 13px;
    }

    .node-label {
        display: none;
    }

    .node-circle {
        width: 26px;
        height: 26px;
        margin-bottom: 0;
        border-width: 3px;
        font-size: 11px;
    }

    .progress-node::before {
        top: 13px;
    }

    .wizard-progress-bar,
    .progress-node,
    .step-card,
    .form-section {
        min-width: 0;
        max-width: 100%;
    }

    .step-header h2,
    .step-lead {
        overflow-wrap: anywhere;
    }

    .step-card {
        padding: 25px 18px;
        border-radius: 15px;
    }

    .step-header {
        margin-bottom: 20px;
        padding-bottom: 18px;
    }

    .step-header h2 {
        font-size: 23px;
    }

    .step-lead {
        font-size: 14px;
    }

    .form-section {
        padding: 18px 15px;
        border-radius: 12px;
    }

    .type-cards-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .ticket-hero-header {
        flex-direction: column;
        gap: 15px;
    }

    .ticket-hero-badges {
        align-items: flex-start;
    }

    .ticket-details-panel {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 440px) {
    .wizard-top-header {
        align-items: center;
        gap: 8px;
    }

    .brand-container {
        gap: 9px;
    }

    .brand-subtitle {
        max-width: 145px;
    }

    .admin-login-link {
        padding: 8px 9px;
        white-space: nowrap;
    }

    .admin-link-full {
        display: none;
    }

    .admin-link-short {
        display: inline;
    }
}
