/* ─────────────────────────────────────────────────────────────────────
   CRMRS Agency Portal — design system
   Warm amber accent (matches the CRMRS desktop app), deep-ink hero,
   restrained motion. Class names are kept stable for the JS layer.
   ─────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@600;700;800;900&family=Hanken+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
    /* Cream / orange base theme — matches the main marketing site. */
    --brand:       #FF4D00;
    --brand-600:   #D63E00;
    --brand-700:   #B53400;
    --brand-tint:  #FFE9DF;
    --brand-glow:  rgba(255, 77, 0, .32);

    --ink:         #100F0C;   /* hero / dark surfaces */
    --ink-2:       #1C1A16;

    --bg:          #F8F4EC;   /* creamy base */
    --bg-soft:     #F1EBDD;
    --surface:     #FFFDF8;   /* card surface */
    --surface-alt: #F1EBDD;
    --border:      #E6DDCA;   /* warm hairline */
    --border-soft: #EFE7D6;

    --text:        #2A2823;
    --text-muted:  #756F62;
    --text-dim:    #A39C8C;

    --success:     #1E8E5A;
    --success-tint:#E7F6EE;
    --warning:     #C2410C;
    --warning-tint:#FFF0E6;
    --danger:      #D63A2E;
    --danger-tint: #FBEAE8;
    --info:        #2C5F9E;

    --radius-sm: 10px;
    --radius:    14px;
    --radius-lg: 18px;

    --shadow-xs: 0 1px 2px rgba(16, 15, 12, .05);
    --shadow-sm: 0 2px 8px rgba(16, 15, 12, .06);
    --shadow:    0 8px 26px rgba(16, 15, 12, .10), 0 2px 6px rgba(16, 15, 12, .05);
    --shadow-md: 0 16px 44px rgba(16, 15, 12, .14), 0 4px 12px rgba(16, 15, 12, .06);
    --shadow-lg: 0 30px 70px rgba(16, 15, 12, .24);

    --font:      'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-head: 'Archivo', 'Hanken Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--brand); color: #fff; }

/* Typeface roles to match the main site: Archivo for headings/brand,
   JetBrains Mono for kickers/labels/eyebrows. */
h1, h2, h3, h4,
.brand .brand-word,
.section-head h2, .card h2, .modal h3,
.hero h1, .cta-band h2 { font-family: var(--font-head); letter-spacing: -.02em; }
.section-head .kicker, .label, .hero .eyebrow { font-family: var(--font-mono); }

/* ── Layout ────────────────────────────────────────────────────────── */
.container        { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 560px;  margin: 0 auto; padding: 0 24px; }
.section    { padding: 64px 0; }
.section-sm { padding: 36px 0; }

/* ── Header ────────────────────────────────────────────────────────── */
.site-header {
    background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid var(--border-soft);
    padding: 12px 0;
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.site-header .container {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .brand-logo {
    height: 38px; width: 38px; border-radius: 10px;
    object-fit: contain; background: #fff;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-soft);
    padding: 3px;
}
.brand .brand-word {
    font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--ink);
}
.brand .brand-word b { color: var(--brand); font-weight: 800; }
.brand img:not(.brand-logo) { height: 34px; width: auto; }
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* ── Footer ────────────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border-soft);
    padding: 28px 0;
    color: var(--text-muted);
    font-size: 13px;
    background: var(--bg-soft);
}
.site-footer .container {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
}

/* ── Hero (dark) ───────────────────────────────────────────────────── */
.hero {
    position: relative;
    background: var(--ink);
    color: #fff;
    text-align: center;
    padding: 92px 24px 88px;
    overflow: hidden;
}
.hero::before {     /* warm glow */
    content: '';
    position: absolute; left: 50%; top: -160px;
    width: 720px; height: 720px; transform: translateX(-50%);
    background: radial-gradient(circle, var(--brand-glow) 0%, transparent 62%);
    pointer-events: none;
}
.hero::after {      /* faint grid */
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 72%);
            mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 72%);
    pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    color: #FDBA8C;
    background: rgba(234, 88, 12, .14);
    border: 1px solid rgba(234, 88, 12, .30);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase;
    margin-bottom: 22px;
}
.hero .eyebrow::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: var(--brand); box-shadow: 0 0 0 4px rgba(234,88,12,.25);
}
.hero h1 {
    font-size: clamp(30px, 4.6vw, 50px);
    line-height: 1.12; letter-spacing: -.025em;
    margin: 0 auto 18px; max-width: 760px; font-weight: 800;
}
.hero h1 .hl {
    background: linear-gradient(120deg, #FB923C, #F97316);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
    color: #AEB7C6; font-size: 17.5px;
    max-width: 600px; margin: 0 auto 34px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-meta {
    margin-top: 30px; display: flex; gap: 26px; justify-content: center;
    flex-wrap: wrap; color: #8D97A8; font-size: 13px;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { color: var(--brand); }

/* ── Section heading ───────────────────────────────────────────────── */
.section-head { text-align: center; max-width: 600px; margin: 0 auto 40px; }
.section-head .kicker {
    color: var(--brand); font-weight: 700; font-size: 12.5px;
    letter-spacing: .08em; text-transform: uppercase;
}
.section-head h2 {
    font-size: clamp(24px, 3vw, 33px); letter-spacing: -.02em;
    margin: 8px 0 8px; font-weight: 800;
}
.section-head p { color: var(--text-muted); margin: 0; font-size: 15.5px; }

/* ── Feature grid ──────────────────────────────────────────────────── */
.feature-grid {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.feature {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 26px 24px;
    box-shadow: var(--shadow-xs);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease),
                border-color .25s var(--ease);
}
.feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}
.feature .ico {
    width: 46px; height: 46px;
    background: linear-gradient(150deg, var(--brand-tint), #fff);
    color: var(--brand);
    border: 1px solid #F6D9C4;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.feature .ico svg { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.feature p  { margin: 0; color: var(--text-muted); font-size: 14px; }

/* ── Steps strip ───────────────────────────────────────────────────── */
.steps {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    counter-reset: step;
}
.step-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 24px 22px 22px;
}
.step-card::before {
    counter-increment: step; content: counter(step);
    position: absolute; top: -16px; left: 22px;
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--ink); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px;
    box-shadow: var(--shadow-sm);
}
.step-card h3 { margin: 12px 0 5px; font-size: 15.5px; font-weight: 700; }
.step-card p  { margin: 0; color: var(--text-muted); font-size: 13.8px; }

/* ── CTA band ──────────────────────────────────────────────────────── */
.cta-band {
    position: relative; overflow: hidden;
    background: var(--ink);
    border-radius: var(--radius-lg);
    padding: 48px 40px; text-align: center;
    color: #fff;
}
.cta-band::before {
    content: ''; position: absolute; right: -120px; top: -120px;
    width: 360px; height: 360px;
    background: radial-gradient(circle, var(--brand-glow), transparent 65%);
}
.cta-band > * { position: relative; }
.cta-band h2 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 8px; font-weight: 800; letter-spacing: -.02em; }
.cta-band p  { color: #AEB7C6; margin: 0 0 22px; }

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 32px;
}
.card h2 { margin: 0 0 6px; font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.card .subtitle { color: var(--text-muted); margin: 0 0 24px; font-size: 14.5px; }

/* ── Forms ─────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.label {
    display: block; font-size: 12px; font-weight: 700;
    color: var(--text-muted); letter-spacing: .04em;
    text-transform: uppercase; margin-bottom: 7px;
}
.input, .textarea, .select {
    width: 100%;
    background: var(--surface);
    color: var(--text);   /* explicit dark text — was inheriting a light color in the ticket modal (invisible white-on-white) */
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    font-size: 14.5px;
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.input:hover, .textarea:hover, .select:hover { border-color: #CBD2DC; }
.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(234, 88, 12, .14);
}
.textarea { min-height: 92px; resize: vertical; }
.help { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; }

/* File upload */
.file-drop {
    border: 1.5px dashed #CBD2DC;
    border-radius: var(--radius-sm);
    padding: 20px; text-align: center;
    background: var(--surface-alt);
    cursor: pointer;
    transition: border-color .16s var(--ease), background .16s var(--ease);
}
.file-drop:hover { border-color: var(--brand); background: var(--brand-tint); }
.file-drop input[type=file] { display: none; }
.file-drop .file-name { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.file-preview { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.file-preview img {
    width: 62px; height: 62px; border-radius: 11px;
    object-fit: cover; border: 1px solid var(--border);
}

/* Email row */
.email-row {
    display: grid; gap: 8px;
    grid-template-columns: 1fr auto; align-items: start;
}
@media (max-width: 560px) { .email-row { grid-template-columns: 1fr; } }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 20px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; letter-spacing: -.01em;
    transition: background .16s var(--ease), color .16s var(--ease),
                border-color .16s var(--ease), box-shadow .16s var(--ease),
                transform .08s var(--ease);
    white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

.btn-primary {
    background: var(--brand); color: #fff;
    box-shadow: 0 4px 14px rgba(234, 88, 12, .30);
}
.btn-primary:hover:not(:disabled) { background: var(--brand-600); box-shadow: 0 6px 20px rgba(234,88,12,.38); }
.btn-primary:active:not(:disabled) { background: var(--brand-700); }

.btn-outline { background: var(--surface); border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-600); background: var(--brand-tint); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); background: var(--surface-alt); }

.btn-dark { background: #fff; color: var(--ink); }
.btn-dark:hover:not(:disabled) { box-shadow: var(--shadow); transform: translateY(-1px); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(.95); }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-danger:hover:not(:disabled)  { filter: brightness(.95); }

.btn-sm { height: 36px; padding: 0 13px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 15px; }

/* ── Badges ────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending  { background: var(--warning-tint); color: #B45309; }
.badge-approved { background: var(--success-tint); color: #047857; }
.badge-rejected { background: var(--danger-tint);  color: #B91C1C; }
.badge-verified { background: var(--success-tint); color: #047857; }

/* ── Stepper ───────────────────────────────────────────────────────── */
.stepper { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 28px; }
.stepper .step { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stepper .step .dot { width: 24px; height: 24px; border-radius: 50%; background: var(--border); color: var(--text-dim); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.stepper .step.active { color: var(--brand); }
.stepper .step.active .dot { background: var(--brand); color: #fff; }
.stepper .step.done .dot { background: var(--success); color: #fff; }
.stepper .sep { width: 32px; height: 2px; background: var(--border); }

/* ── Modal ─────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(11, 17, 32, .58);
    backdrop-filter: blur(3px);
    display: none; align-items: center; justify-content: center;
    padding: 24px; z-index: 100;
}
.modal-backdrop.is-open { display: flex; animation: fade .16s var(--ease); }
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 446px; padding: 30px;
    animation: pop .2s var(--ease);
}
@keyframes pop  { from { transform: scale(.95) translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.modal p  { margin: 0 0 18px; color: var(--text-muted); font-size: 14px; }

/* ── OTP input ─────────────────────────────────────────────────────── */
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; margin: 10px 0 18px; }
.otp input {
    width: 100%; height: 54px;
    text-align: center; font-size: 21px; font-weight: 700;
    border: 1.5px solid var(--border); border-radius: 11px;
    background: var(--surface);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .08s var(--ease);
}
.otp input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(234,88,12,.15); transform: translateY(-2px); }
.otp-actions { display: flex; gap: 10px; justify-content: space-between; align-items: center; }

/* ── Toast ─────────────────────────────────────────────────────────── */
.toast-container { position: fixed; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 9px; z-index: 200; max-width: 370px; }
.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: 11px;
    box-shadow: var(--shadow);
    padding: 13px 16px; font-size: 14px;
    animation: slide-in .22s var(--ease);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.info    { border-left-color: var(--info); }
@keyframes slide-in { from { transform: translateX(26px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ── Table (manage) ────────────────────────────────────────────────── */
.table-card { padding: 0; overflow: hidden; }
.table-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    padding: 16px 22px; border-bottom: 1px solid var(--border-soft);
}
.table-toolbar h2 { margin: 0; font-size: 16px; font-weight: 800; }
.tabs { display: inline-flex; gap: 4px; background: var(--surface-alt); padding: 4px; border-radius: 10px; }
.tabs button {
    padding: 7px 13px; border-radius: 7px; font-size: 12.5px; font-weight: 700;
    color: var(--text-muted); transition: background .14s var(--ease), color .14s var(--ease);
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--brand-600); box-shadow: var(--shadow-xs); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 15px 22px; font-size: 13.5px; border-bottom: 1px solid var(--border-soft); }
table.data th { background: var(--surface-alt); color: var(--text-muted); text-transform: uppercase; font-size: 11.5px; letter-spacing: .04em; font-weight: 700; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s var(--ease); }
table.data tbody tr:hover td { background: #FBFCFD; }
table.data .agency-cell { display: flex; align-items: center; gap: 11px; }
table.data .agency-cell img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; border: 1px solid var(--border-soft); background: var(--surface-alt); }
table.data .name { font-weight: 700; color: var(--text); }
table.data .muted { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ── Empty state ───────────────────────────────────────────────────── */
.empty { padding: 64px 24px; text-align: center; color: var(--text-muted); }
.empty .ico {
    width: 58px; height: 58px; border-radius: 15px;
    background: var(--surface-alt); color: var(--text-dim);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 25px; margin-bottom: 12px;
}

/* ── Lock icon (manage gate) ───────────────────────────────────────── */
.lock-badge {
    width: 60px; height: 60px; border-radius: 16px;
    background: linear-gradient(150deg, var(--brand-tint), #fff);
    border: 1px solid #F6D9C4; color: var(--brand);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.lock-badge svg { width: 28px; height: 28px; }

/* ── Spinner ───────────────────────────────────────────────────────── */
.spinner {
    width: 18px; height: 18px;
    border: 2.5px solid currentColor; border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Entrance animations ───────────────────────────────────────────── */
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; animation: fade-up .6s var(--ease) forwards; }
.reveal.d1 { animation-delay: .07s; }
.reveal.d2 { animation-delay: .14s; }
.reveal.d3 { animation-delay: .21s; }
.reveal.d4 { animation-delay: .28s; }
.reveal.d5 { animation-delay: .35s; }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001s !important; animation-delay: 0s !important; scroll-behavior: auto; }
    .feature:hover { transform: none; }
}

/* ── Utilities ─────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:32px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}.mb-4{margin-bottom:32px}
.flex{display:flex}.flex-col{flex-direction:column}.items-center{align-items:center}
.gap-2{gap:8px}.gap-3{gap:12px}.justify-between{justify-content:space-between}
.hidden { display: none !important; }
