/* ============================================================
   Agent area — login, register, dashboard, plans, settings
   Single source of truth. The keypad stays the hero element.
   ============================================================ */

/* ── Design tokens (single definition) ── */
:root {
    --ink:         #10221c;
    --muted:       #5a6f67;
    --paper:       #f2f6f4;
    --surface:     #ffffff;
    --line:        #e2e9e5;
    --field:       #b9c7c1;

    --brand:       #0f7a5c;
    --brand-dark:  #0a5c44;
    --brand-tint:  #e9f5f0;
    --brand-soft:  #c9e8db;
    --brand-glow:  rgba(15, 122, 92, .12);

    --danger:      #b42318;
    --danger-bg:   #fef3f2;
    --danger-line: #f3b9b3;

    --focus:       #0f7a5c;
    --key:         #f4f7f5;
    --key-hover:   #e8efeb;
    --key-active:  #dce7e1;

    --radius-lg:   18px;
    --radius-md:   12px;
    --radius-sm:   10px;

    --shadow-card: 0 10px 30px -12px rgba(10, 50, 38, .14),
                   0 2px 6px rgba(10, 50, 38, .05);
    --shadow-top:  0 10px 26px -8px rgba(15, 122, 92, .5);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    padding: 1.25rem;
    padding-left:  max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    background:
        radial-gradient(900px 500px at 85% -10%, #dcf0e7 0%, transparent 60%),
        radial-gradient(700px 500px at -10% 110%, #dcebe3 0%, transparent 55%),
        var(--paper);
    -webkit-font-smoothing: antialiased;
}

/* Logged-in pages opt out of the centered flex layout */
body.app { display: block; padding: 0; background: var(--paper); }

a { color: var(--brand); font-weight: 500; text-decoration: none; }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ══════════════════════════════════════════════════════════
   Auth panel (login / register)
   ══════════════════════════════════════════════════════════ */

/* margin:auto so a tall panel never clips its top on small screens */
.panel {
    width: 100%;
    max-width: 440px;
    margin: auto;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-card);
    animation: rise .45s cubic-bezier(.22, 1, .36, 1) both;
}
.panel.wide { max-width: 520px; }

@keyframes rise {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

h1 { font-size: 1.55rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin-bottom: 0.4rem; }
h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.25rem; }
.lede { color: var(--muted); margin-bottom: 1.5rem; max-width: 60ch; }
.step-note { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.9rem; }
.hint { color: var(--muted); font-size: 0.84rem; margin-top: 0.3rem; }
.foot { margin-top: 1.5rem; color: var(--muted); font-size: 0.92rem; text-align: center; padding-top: 1.1rem; border-top: 1px solid var(--line); }

/* ── Alerts ── */
.alert {
    background: var(--danger-bg);
    border: 1px solid var(--danger-line);
    color: #7a1810;
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
    animation: shake .4s ease;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-5px); }
    75%      { transform: translateX(5px); }
}

/* ── Fields ── */
.field { margin-bottom: 1.1rem; }
label, legend { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 0.35rem; }
input[type="text"], input[type="tel"], input[type="email"] {
    width: 100%;
    min-height: 48px;
    padding: 0.65rem 0.8rem;
    border: 1.5px solid var(--field);
    border-radius: var(--radius-md);
    font: inherit;
    color: var(--ink);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:hover, input[type="tel"]:hover, input[type="email"]:hover { border-color: var(--muted); }
input[type="text"]:focus-visible, input[type="tel"]:focus-visible, input[type="email"]:focus-visible {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-glow);
}
.field.has-error input { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: 0.84rem; margin-top: 0.3rem; }

/* ── Agent type choice ── */
fieldset { border: 0; }
.choices { display: grid; gap: 0.75rem; margin-bottom: 1.25rem; }
.choice { display: block; position: relative; cursor: pointer; margin: 0; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice .box {
    display: block;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    padding: 0.9rem 1rem;
    background: #fff;
    transition: border-color .15s, background .15s, transform .12s, box-shadow .15s;
}
.choice:hover .box { border-color: var(--brand-soft); }
.choice .box strong { display: block; font-weight: 600; }
.choice .box span { color: var(--muted); font-size: 0.86rem; font-weight: 400; }
.choice input:checked + .box {
    border-color: var(--brand);
    background: var(--brand-tint);
    box-shadow: inset 0 0 0 1px var(--brand), var(--shadow-card);
}
.choice input:focus-visible + .box { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ── Buttons ── */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: var(--shadow-top);
    transition: transform .12s, box-shadow .12s, opacity .2s, background .15s;
}
.btn:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 14px 28px -8px rgba(15, 122, 92, .55); }
.btn:active { transform: translateY(1px); }
.btn:disabled {
    background: #c3cfc9;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.secondary:hover { background: var(--paper); color: var(--ink); }
.stack > * + * { margin-top: 0.75rem; }

/* ── Agent code with fixed AG prefix ── */
.code-input {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--field);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.code-input .prefix {
    display: flex;
    align-items: center;
    padding: 0 0.85rem;
    background: var(--brand-tint);
    border-right: 1px solid var(--line);
    font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--brand-dark);
}
.code-input input {
    border: 0;
    border-radius: 0;
    font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
    font-size: 1.15rem;
    letter-spacing: 0.18em;
}
.code-input:focus-within {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-glow);
}
.code-input input:focus-visible { outline: none; }

/* ── PIN dots + keypad (the hero) ── */
.pin-label { text-align: center; font-weight: 500; font-size: 0.9rem; margin-top: 1.4rem; }
.pin-dots { display: flex; justify-content: center; gap: 0.9rem; margin: 0.9rem 0 1.3rem; }
.dot {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid var(--field);
    background: transparent;
    transition: background .15s, border-color .15s, transform .18s cubic-bezier(.22, 1, .36, 1), box-shadow .15s;
}
.dot.filled {
    background: var(--brand);
    border-color: var(--brand);
    transform: scale(1.12);
    box-shadow: 0 3px 8px -2px rgba(15, 122, 92, .5);
}
.dot.pop { animation: pop .22s ease; }
@keyframes pop { 50% { transform: scale(1.4); } }

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    max-width: 300px;
    margin: 0 auto 1.5rem;
}
.key {
    min-height: 62px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--key);
    color: var(--ink);
    font: 600 1.5rem/1 'IBM Plex Sans', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    box-shadow: 0 2px 0 rgba(16, 50, 40, .1);
    transition: background .12s, transform .08s, box-shadow .12s;
}
.key:hover { background: var(--key-hover); }
.key:active, .key.pressed {
    background: var(--key-active);
    transform: translateY(2px) scale(.97);
    box-shadow: none;
}
.key:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.key.action { background: transparent; color: var(--muted); font-size: 1rem; font-weight: 500; box-shadow: none; }
.key.action:hover { color: var(--danger); background: var(--key-hover); }
.key.action svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Success: the agent code shown like a card number ── */
.code-display {
    font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
    font-size: 2.4rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-align: center;
    color: var(--brand-dark);
    border: 1.5px dashed var(--brand);
    border-radius: var(--radius-md);
    background: var(--brand-tint);
    padding: 1.1rem;
    margin: 1.25rem 0 0.75rem;
}

/* ══════════════════════════════════════════════════════════
   Logged-in agent area
   ══════════════════════════════════════════════════════════ */

/* ── Top bar ── */
.topbar {
    background: linear-gradient(120deg, var(--brand-dark) 0%, var(--ink) 100%);
    color: #fff;
    box-shadow: 0 4px 18px -6px rgba(10, 50, 38, .4);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    padding-left:  max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    flex-wrap: wrap;
}
.topbar .who { font-weight: 600; }
.topbar .code {
    font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
    font-weight: 500;
    opacity: 0.85;
    margin-left: 0.6rem;
    font-size: 0.9rem;
}
.topbar nav { display: flex; gap: 0.4rem; }
.topbar a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    opacity: 0.85;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    transition: opacity .15s, background .15s;
}
.topbar a:hover { opacity: 1; background: rgba(255, 255, 255, .12); text-decoration: none; }
.topbar a:focus-visible { outline-color: #fff; }

/* ── Page ── */
.page { max-width: 960px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
.page h1 { font-size: 1.5rem; margin-bottom: 1rem; }
.notice {
    background: var(--brand-tint);
    border: 1px solid var(--brand-soft);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.94rem;
}

/* ── Cards ── */
.cards { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1.5rem; }
@media (min-width: 760px) { .cards { grid-template-columns: 3fr 2fr; } }
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow-card);
}
.card h2 { margin-bottom: 0.6rem; }

.package-name { font-weight: 600; font-size: 1.05rem; }
.meta { color: var(--muted); font-size: 0.9rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.1rem 0 1.25rem; }
.stat .num { font-size: 2rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--brand-dark); }
.stat .lbl { color: var(--muted); font-size: 0.85rem; }

/* ── Customers ── */
.search { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.search input { flex: 1; }
.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--line);
    transition: background .12s;
}
.row:hover { background: linear-gradient(90deg, var(--brand-tint), transparent 70%); border-radius: var(--radius-sm); }
.row .name { font-weight: 500; }
.row .sub { color: var(--muted); font-size: 0.84rem; }
.empty { color: var(--muted); padding: 1rem 0 0.25rem; }

.badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    margin-left: 0.4rem;
    white-space: nowrap;
}
.badge.ok { border-color: var(--brand-soft); background: var(--brand-tint); color: var(--brand-dark); }
.btn.small { width: auto; min-height: 40px; padding: 0.4rem 0.95rem; font-size: 0.9rem; flex-shrink: 0; border-radius: var(--radius-sm); }

/* ── Packages ── */
.period {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-card);
}
.period label { position: relative; margin: 0; cursor: pointer; }
.period input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.period span { display: block; padding: 0.6rem 1.1rem; font-weight: 500; font-size: 0.92rem; transition: background .15s, color .15s; }
.period input:checked + span { background: var(--ink); color: #fff; }
.period input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: -3px; }

.plans { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .plans { grid-template-columns: repeat(4, 1fr); } }
.plans[data-period="monthly"] .for-yearly { display: none; }
.plans[data-period="yearly"] .for-monthly { display: none; }

.plan {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: transform .18s cubic-bezier(.22, 1, .36, 1), box-shadow .18s, border-color .18s;
}
.plan:hover {
    transform: translateY(-3px);
    border-color: var(--brand-soft);
    box-shadow: 0 18px 40px -14px rgba(10, 50, 38, .22);
}
.plan h3 { font-size: 1.05rem; font-weight: 600; }
.plan .price { font-size: 1.6rem; font-weight: 600; margin: 0.5rem 0 0.1rem; font-variant-numeric: tabular-nums; }
.plan .per { color: var(--muted); font-size: 0.85rem; }
.plan .save { color: var(--brand-dark); font-weight: 600; font-size: 0.88rem; min-height: 1.4em; margin-top: 0.3rem; }
.plan ul { list-style: none; margin: 0.8rem 0 1.1rem; font-size: 0.92rem; }
.plan li { padding: 0.25rem 0; }
.plan .buy { margin-top: auto; }
.fine { color: var(--muted); font-size: 0.86rem; margin-top: 1.25rem; max-width: 70ch; }

/* ── Settings ── */
.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; font-size: 0.94rem; }
.details dt { color: var(--muted); }
.details dd { font-weight: 500; word-break: break-word; }
.narrow { max-width: 440px; }

/* ── Small screens ── */
@media (max-width: 480px) {
    body { padding: 0.75rem; }
    .panel { padding: 1.4rem 1.1rem; border-radius: 14px; }
    h1 { font-size: 1.4rem; }
    .code-display { font-size: 2.1rem; }
    .page { padding: 1.1rem 0.9rem 2.5rem; }
    .card { padding: 1.1rem; }
    .stat .num { font-size: 1.6rem; }
    .row { align-items: flex-start; flex-direction: column; gap: 0.5rem; }
}

.brandmark {
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px;
    margin: 0 auto 20px;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--brand) 0%, var(--brand-dark) 100%);
    box-shadow: 0 10px 22px -8px rgba(15, 122, 92, .55);
    color: #fff;
}
.brandmark svg { width: 26px; height: 26px; }


/* ── Brandmark (shared with login.php) ── */
.brandmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--brand) 0%, var(--brand-dark) 100%);
    box-shadow: 0 10px 22px -8px rgba(15, 122, 92, .55);
    color: #fff;
}
.brandmark svg { width: 26px; height: 26px; }
.brandmark.success { animation: rise .45s cubic-bezier(.22, 1, .36, 1) .1s both; }

/* ── Step progress bar (register.php) ── */
.steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: -0.5rem 0 1.5rem;
}
.steps .step {
    height: 5px;
    width: 48px;
    border-radius: 999px;
    background: var(--line);
    transition: background .3s ease, transform .3s ease;
}
.steps .step.active {
    background: var(--brand);
    transform: scaleY(1.2);
}

/* ── Agent type choice cards (with icons) ── */
.choice .box {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}
.choice .icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--paper);
    color: var(--muted);
    transition: background .18s, color .18s;
}
.choice .icon svg {
    width: 22px;
    height: 22px;
}
.choice input:checked + .box .icon {
    background: var(--brand);
    color: #fff;
}
.choice .choice-text { display: block; }

/* Smooth reveal when the details appear after picking a type */
#detailsFields:not([hidden]) { animation: rise .35s cubic-bezier(.22, 1, .36, 1) both; }

/* ── Locked details (visible but disabled until agent type is chosen) ── */
#detailsFields {
    transition: opacity .3s ease;
}
#detailsFields.locked {
    opacity: 0.5;
    position: relative;
}
#detailsFields.locked::after {
    /* keeps clicks from reaching anything inside, belt-and-braces on top of disabled */
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.lock-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--brand-tint);
    border: 1px dashed var(--brand-soft);
    color: var(--brand-dark);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1.1rem;
}
.lock-hint svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

#detailsFields.locked .lock-hint {
    /* hint stays fully readable even while the fields are dimmed */
    opacity: 1;
}


/* ============================================================
   Agent dashboard — loaded after agent.css
   ============================================================ */

/* ── Greeting ── */
.greet {
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
    color: var(--ink);
}
.greet strong { color: var(--brand-dark); }

/* ── Notice variants ── */
.notice.warn {
    background: #fff7e8;
    border: 1px solid #f0dcb2;
    border-left: 4px solid #d9930d;
    color: #7a5205;
}

/* ── Topbar additions ── */
.who-wrap { display: flex; align-items: center; min-width: 0; }
.avatar {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .15);
    border: 1.5px solid rgba(255, 255, 255, .35);
    font-weight: 600;
    font-size: 0.95rem;
    margin-right: 0.65rem;
}

/* ── Stat tiles ── */
.stat {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 0.8rem 0.9rem;
    transition: border-color .18s, box-shadow .18s;
}
.stat:hover {
    border-color: var(--brand-soft);
    box-shadow: 0 4px 14px -6px rgba(10, 50, 38, .12);
}
.stat-danger .num { color: var(--danger); }

/* ── New-CV submit with icon + loading state ── */
.btn svg { width: 18px; height: 18px; margin-right: 0.45rem; }
.btn.is-loading { opacity: .7; cursor: wait; }
.btn.is-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    margin-left: 0.5rem;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Customers header row ── */
.cust-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}
.cust-head h2 { margin-bottom: 0; }

/* ── Search ── */
.search {
    position: relative;
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    display: flex;
}
.search-icon svg { width: 17px; height: 17px; }
.search input {
    flex: 1;
    padding-left: 2.5rem;
}
.search input:focus-visible + .btn.secondary { border-color: var(--brand); }

/* ── Customer rows ── */
.cust-list { display: block; }
.row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 0.5rem;
    border-top: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: background .12s;
}
.row:hover { background: linear-gradient(90deg, var(--brand-tint), transparent 75%); }
.row-avatar {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--brand-tint);
    border: 1.5px solid var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 600;
    font-size: 0.95rem;
}
.row-main { flex: 1; min-width: 0; }
.row-main .name {
    font-weight: 600;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem;
}
.row-action { flex-shrink: 0; }

.btn.ghost {
    background: transparent;
    color: var(--brand);
    border: 1.5px solid var(--brand-soft);
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.btn.ghost svg { width: 15px; height: 15px; margin: 0; }
.btn.ghost:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    transform: none;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 2.25rem 1rem 1.5rem;
}
.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.9rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--paper);
    border: 1.5px dashed var(--line);
    color: var(--muted);
}
.empty-icon svg { width: 30px; height: 30px; }
.empty-title { font-weight: 600; font-size: 1.02rem; }
.empty-sub { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }

/* ── Small screens ── */
@media (max-width: 480px) {
    .greet { font-size: 1.15rem; }
    .row { align-items: flex-start; }
    .row-action { width: 100%; }
    .row-action .btn { width: 100%; }
    .search input { min-width: 0; }
}

/* ── Package badges ── */
.plan { position: relative; }

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.28rem 0.8rem;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 4px 10px -3px rgba(10, 50, 38, .25);
}
.plan-badge.try { background: #eef4f8; color: #41618a; border: 1px solid #cfdfe9; }   /* Daily — Try it */
.plan-badge.go  { background: #fdf1e3; color: #9a5b0f; border: 1px solid #f0d9b4; }   /* Starter — Get going */
.plan-badge.pop {                                                                     /* Business — Most popular */
    background: linear-gradient(145deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
}
.plan-badge.pro { background: #1f2833; color: #ffd166; }                              /* Unlimited — For busy agents */

/* ── Featured (Most popular) card ── */
.plan.featured {
    border: 2px solid var(--brand);
    box-shadow: 0 18px 44px -14px rgba(15, 122, 92, .38);
}
@media (min-width: 700px) {
    .plan.featured { transform: scale(1.03); }
    .plan.featured:hover { transform: scale(1.03) translateY(-3px); }
}

/* ── Current plan marker ── */
.plan.current { border-color: var(--brand-dark); background: linear-gradient(180deg, var(--brand-tint), #fff 40%); }

/* ── Feature list checkmarks ── */
.plan ul li { display: flex; align-items: flex-start; gap: 0.5rem; }


/* ── Agent code chip (settings) ── */
.mono-chip {
    font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
    font-weight: 500;
    background: var(--brand-tint);
    border: 1px solid var(--brand-soft);
    color: var(--brand-dark);
    border-radius: 8px;
    padding: 0.15rem 0.6rem;
    letter-spacing: 0.06em;
}

/* ── Small icon next to a card heading ── */
h2 { display: flex; align-items: center; gap: 0.5rem; }
.h-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--brand-tint);
    color: var(--brand-dark);
}
.h-icon svg { width: 16px; height: 16px; }

/* ── Support box (settings) — WhatsApp-first ── */
.support-box {
    margin-top: 1.25rem;
    background: var(--brand-tint);
    border: 1px solid var(--brand-soft);
    border-radius: var(--radius-md);
    padding: 1rem;
}
.support-head {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
}
.support-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--brand);
    color: #fff;
}
.support-icon svg { width: 17px; height: 17px; }
.support-head strong { display: block; font-size: 0.95rem; }
.support-sub { color: var(--brand-dark); font-size: 0.84rem; margin-top: 0.1rem; }

.support-links { display: grid; gap: 0.5rem; }

.support-btn {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--ink);
    border: 1px solid var(--line);
    background: #fff;
    transition: transform .12s, box-shadow .15s, border-color .15s, background .15s;
}
.support-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -5px rgba(10, 50, 38, .25);
}
.support-btn:active { transform: translateY(0); }
.support-btn svg { flex: 0 0 20px; width: 20px; height: 20px; }
.support-btn small {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.75;
}

/* WhatsApp — the hero action */
.support-btn.whatsapp {
    background: #25d366;
    border-color: #1eb85a;
    color: #fff;
}
.support-btn.whatsapp svg { color: #fff; }
.support-btn.whatsapp small { opacity: 0.9; }
.support-btn.whatsapp:hover {
    background: #1fc85c;
    box-shadow: 0 6px 16px -5px rgba(37, 211, 102, .55);
}

/* Phone + email — quieter secondary options */
.support-btn.phone svg { color: var(--brand); }
.support-btn.email svg { color: var(--brand); }
.support-btn.phone:hover,
.support-btn.email:hover { border-color: var(--brand); }


/* Agent area: register + login. Quiet, bank-like; the keypad is the one distinctive element. */

:root {
    --ink: #15233b;
    --muted: #55607a;
    --paper: #f3f4f6;
    --surface: #ffffff;
    --line: #d5dae3;
    --field: #aab2c0;
    --brand: #0c6b58;
    --brand-dark: #09524a;
    --brand-tint: #f0f8f5;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --focus: #2563eb;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    padding: 1.25rem;
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}

/* margin:auto (not flex centering) so a tall panel never clips its top on small screens */
.panel {
    width: 100%;
    max-width: 440px;
    margin: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 2rem;
}
.panel.wide { max-width: 520px; }

h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin-bottom: 0.4rem; }
h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.25rem; }
.lede { color: var(--muted); margin-bottom: 1.5rem; max-width: 60ch; }
.step-note { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.9rem; }
.hint { color: var(--muted); font-size: 0.84rem; margin-top: 0.3rem; }
.foot { margin-top: 1.5rem; color: var(--muted); font-size: 0.92rem; }
a { color: var(--brand); font-weight: 500; }
a:hover { color: var(--brand-dark); }

/* ── Alerts ── */
.alert {
    background: var(--danger-bg);
    border: 1px solid #f3b9b3;
    color: #7a1810;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
}

/* ── Fields ── */
.field { margin-bottom: 1.1rem; }
label, legend { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 0.35rem; }
input[type="text"], input[type="tel"], input[type="email"] {
    width: 100%;
    min-height: 48px;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--field);
    border-radius: 10px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}
.field.has-error input { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: 0.84rem; margin-top: 0.3rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input[type="text"]:focus-visible, input[type="tel"]:focus-visible, input[type="email"]:focus-visible {
    outline-offset: 0;
    border-color: var(--focus);
}

/* ── Agent type choice ── */
fieldset { border: 0; }
.choices { display: grid; gap: 0.75rem; margin-bottom: 1.25rem; }
.choice { display: block; position: relative; cursor: pointer; margin: 0; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice .box {
    display: block;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    background: #fff;
}
.choice .box strong { display: block; font-weight: 600; }
.choice .box span { color: var(--muted); font-size: 0.86rem; font-weight: 400; }
.choice input:checked + .box { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.choice input:focus-visible + .box { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ── Buttons ── */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn:disabled { background: #b9c2cf; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--paper); color: var(--ink); }
.stack > * + * { margin-top: 0.75rem; }

/* ── Agent code with fixed AG prefix ── */
.code-input {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--field);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.code-input .prefix {
    display: flex;
    align-items: center;
    padding: 0 0.85rem;
    background: var(--paper);
    border-right: 1px solid var(--line);
    font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
    font-weight: 500;
    font-size: 1.15rem;
}
.code-input input {
    border: 0;
    border-radius: 0;
    font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
    font-size: 1.15rem;
    letter-spacing: 0.14em;
}
.code-input:focus-within { outline: 3px solid var(--focus); outline-offset: 0; }
.code-input input:focus-visible { outline: none; }

/* ── PIN dots + keypad (the one distinctive element) ── */
.pin-label { text-align: center; font-weight: 500; font-size: 0.9rem; margin-top: 1.4rem; }
.pin-dots { display: flex; justify-content: center; gap: 0.9rem; margin: 0.9rem 0 1.3rem; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; }
.dot.filled { background: var(--ink); }

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    max-width: 300px;
    margin: 0 auto 1.5rem;
}
.key {
    min-height: 62px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font: 600 1.5rem/1 'IBM Plex Sans', system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.key:active { background: #e6eaf1; }
.key:disabled { opacity: 0.4; cursor: not-allowed; }
.key.action { background: var(--paper); color: var(--muted); font-size: 1rem; font-weight: 500; }

/* ── Success: the agent code shown like a card number ── */
.code-display {
    font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
    font-size: 2.6rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-align: center;
    border: 1.5px dashed var(--brand);
    border-radius: 12px;
    background: var(--brand-tint);
    padding: 1rem;
    margin: 1.25rem 0 0.75rem;
}

@media (max-width: 480px) {
    body { padding: 0.75rem; }
    .panel { padding: 1.4rem 1.1rem; border-radius: 14px; }
    h1 { font-size: 1.4rem; }
    .code-display { font-size: 2.1rem; }
}

/* ── Recovery (forgot PIN / forgot agent code) ── */
.otp-input {
    text-align: center;
    font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: 0.35em;
    padding-left: 0.35em;   /* balances the trailing letter-spacing so the digits look centred */
}
.notice-ok {
    background: var(--brand-tint);
    border: 1px solid #b7dccf;
    color: var(--brand-dark);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
}
.links { margin-top: 1.25rem; font-size: 0.92rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }

.hero-note {
    color: rgba(255,255,255,.65);
    font-size: .85rem;
    margin-top: 1rem;
    letter-spacing: .01em;
}


.free-bridge { padding: 0 0 3.5rem; }
.free-bridge-card {
    background: linear-gradient(135deg, var(--brand-tint) 0%, #f6fdfa 100%);
    border: 1px solid rgba(0, 151, 94, .18);
    border-radius: var(--radius-lg);
    padding: 1.6rem 1.8rem;
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
    max-width: 720px;
    margin: 0 auto;
}
.free-bridge-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--brand);
    color: #fff;
    flex-shrink: 0;
}
.free-bridge-icon svg { width: 22px; height: 22px; }
.free-bridge-card h3 { font-size: 1.05rem; margin-bottom: .25rem; color: var(--ink); }
.free-bridge-card p { color: var(--muted); font-size: .93rem; margin: 0; line-height: 1.55; }
@media (max-width: 480px) {
    .free-bridge-card { padding: 1.3rem; gap: .85rem; }
    .free-bridge-icon { width: 38px; height: 38px; }
}


.price-trust {
    display: flex; flex-wrap: wrap; gap: 1.4rem;
    justify-content: center;
    margin: 2rem 0 .5rem;
    font-size: .85rem; font-weight: 600; color: var(--muted);
}
.price-trust-item { display: inline-flex; align-items: center; gap: .4rem; }
.price-trust-item svg { color: var(--brand); }
.price-note {
    text-align: center;
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: 2rem;
}
.price-note a { text-decoration: underline; }

.cross-link {
    text-align: center;
    font-size: .9rem;
    color: var(--muted);
    margin-top: 1.5rem;
}
.cross-link a { font-weight: 600; color: var(--brand-dark); }


.faq-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: .75rem;
    box-shadow: var(--shadow-card);
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    font-size: .96rem;
    color: var(--ink);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    font-size: 1.3rem;
    color: var(--brand);
    font-weight: 700;
    transition: transform .2s;
    flex-shrink: 0;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
    color: var(--muted);
    font-size: .92rem;
    margin-top: .75rem;
    line-height: 1.6;
}
.faq-item p a { color: var(--brand-dark); text-decoration: underline; }



