/* ==========================================================================
   ABDUL DATA HUB - Base design system
   ========================================================================== */

:root {
    --primary: #16215c;
    --primary-dark: #0d1440;
    --primary-light: #2a3a8f;
    --accent: #00b86b;
    --accent-dark: #009456;
    --accent-light: #e6f9f0;
    --danger: #e5484d;
    --danger-light: #fdecec;
    --warning: #f0b429;
    --warning-light: #fff8e6;
    --info: #2563eb;
    --info-light: #eaf1ff;

    --bg: #eef1fb;
    --surface: #ffffff;
    --text: #1c2233;
    --text-muted: #6b7280;
    --border: #e5e8f0;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(16, 20, 64, 0.06);
    --shadow: 0 4px 16px rgba(16, 20, 64, 0.08);
    --shadow-lg: 0 12px 32px rgba(16, 20, 64, 0.14);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.25; font-weight: 700; color: var(--text); }
p { margin: 0 0 1em; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease, opacity 0.15s ease;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-loading { opacity: 0.65; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

.btn-secondary { background: var(--primary); color: #fff; }
.btn-secondary:hover { background: var(--primary-dark); color: #fff; }

.btn-outline { background: transparent; color: var(--primary); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); }

.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-outline-light:hover { background: rgba(255,255,255,0.12); color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #cf3a3f; color: #fff; }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 15px 28px; font-size: 16px; }

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--text); }
.form-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }

.form-control, select.form-control, textarea.form-control {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(42, 58, 143, 0.12);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: 12.5px; margin-top: 5px; }

.input-group { position: relative; display: flex; align-items: center; }
.input-group .form-control { padding-left: 42px; }
.input-group-icon {
    position: absolute; left: 14px; color: var(--text-muted); pointer-events: none;
}

.password-field { position: relative; display: flex; align-items: center; }
.password-field .form-control { padding-right: 42px; }
.password-toggle {
    position: absolute;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
}
.password-toggle:hover { color: var(--text); background: rgba(0, 0, 0, 0.05); }
.password-toggle:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 1px; }
.password-toggle svg { width: 19px; height: 19px; }
.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-visible .icon-eye { display: none; }
.password-toggle.is-visible .icon-eye-off { display: block; }

/* ---------------------------------------------------------------------
   Alerts / badges
   --------------------------------------------------------------------- */

.alert {
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert-success { background: var(--accent-light); color: var(--accent-dark); border-color: #b9edd3; }
.alert-error { background: var(--danger-light); color: var(--danger); border-color: #f7c7c8; }
.alert-warning { background: var(--warning-light); color: #92650a; border-color: #f5dfa3; }
.alert-info { background: var(--info-light); color: var(--info); border-color: #c6d9fc; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    text-transform: capitalize;
}
.badge-success { background: var(--accent-light); color: var(--accent-dark); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: #92650a; }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-muted { background: #eef0f6; color: var(--text-muted); }

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 600px; }
table th, table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); background: #fafbfd; }
table tbody tr:last-child td { border-bottom: none; }
table tbody tr:hover { background: #fafbfd; }

/* ---------------------------------------------------------------------
   Modals
   --------------------------------------------------------------------- */

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(13, 20, 64, 0.55);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; padding: 16px;
}
.modal-backdrop.is-open { display: flex; }
.modal {
    background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 420px; padding: 26px; max-height: 90vh; overflow-y: auto;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.modal-subtitle { color: var(--text-muted); font-size: 13.5px; margin-bottom: 18px; }
.modal-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.modal-row:last-of-type { border-bottom: none; }
.modal-row span:first-child { color: var(--text-muted); }
.modal-row span:last-child { font-weight: 600; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* ---------------------------------------------------------------------
   Toasts
   --------------------------------------------------------------------- */

#toast-container {
    position: fixed; top: 18px; right: 18px; z-index: 2000;
    display: flex; flex-direction: column; gap: 10px; max-width: 340px;
}
.toast {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
    padding: 14px 16px; font-size: 14px; border-left: 4px solid var(--info);
    animation: toast-in 0.2s ease;
}
.toast.toast-success { border-left-color: var(--accent); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------------------------------------------------------------
   Loading / spinner
   --------------------------------------------------------------------- */

.spinner {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
    animation: spin 0.7s linear infinite; display: inline-block;
}
.spinner-dark { border-color: rgba(22,33,92,0.2); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { background: linear-gradient(90deg, #eef0f6 25%, #f6f7fb 37%, #eef0f6 63%); background-size: 400% 100%; animation: skeleton 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------------------------------------------------------------
   Utilities
   --------------------------------------------------------------------- */

/* ---------------------------------------------------------------------
   Auth pages (login / register / reset)
   --------------------------------------------------------------------- */

.auth-section { padding: 40px 0 60px; display: flex; align-items: center; min-height: calc(100vh - 68px); }
.auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 960px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 48px 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
}
.auth-visual::before {
    content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.06); top: -90px; right: -70px;
}
.auth-visual::after {
    content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
    background: rgba(0, 184, 107, 0.16); bottom: -60px; left: -60px;
}
.auth-visual-content { position: relative; z-index: 1; }
.auth-visual .brand-mark { width: 56px; height: 56px; border-radius: 14px; padding: 6px; margin-bottom: 24px; }
.auth-visual-content h2 { font-size: 25px; color: #fff; margin-bottom: 10px; }
.auth-visual-content p { color: rgba(255, 255, 255, 0.78); font-size: 14.5px; margin-bottom: 28px; }

.auth-feature-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 15px; }
.auth-feature-list li { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, 0.92); }
.auth-feature-list .icon-badge {
    display: flex; align-items: center; justify-content: center; flex: none;
    width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, 0.14); font-size: 15px;
}

.auth-form-panel { padding: 48px 44px; display: flex; align-items: center; }
.auth-form-card { width: 100%; max-width: 360px; margin: 0 auto; }
.auth-form-card h1 { font-size: 23px; margin-bottom: 6px; }

@media (max-width: 860px) {
    .auth-section { padding: 24px 0 40px; min-height: 0; align-items: flex-start; }
    .auth-shell { grid-template-columns: 1fr; max-width: 440px; }
    .auth-visual { display: none; }
    .auth-form-panel { padding: 36px 28px; align-items: flex-start; }
}

/* ---------------------------------------------------------------------
   Network picker (visual network selection with auto-detect + bypass)
   --------------------------------------------------------------------- */

.network-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.network-tile {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 12px 4px;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.network-tile:hover { border-color: var(--primary-light); }
.network-tile.is-selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(42, 58, 143, 0.14); }
.network-tile.is-disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.network-logo {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 11.5px; letter-spacing: -0.2px;
}
.network-logo-mtn { background: #ffcb05; color: #1c2233; }
.network-logo-airtel { background: #ed1c24; color: #fff; }
.network-logo-glo { background: #00a651; color: #fff; }
.network-logo-9mobile { background: #04853d; color: #fff; }

/* Uploaded logo image (images/networks/{slug}.*) - falls back to the
   colored text badges above until a network's file is uploaded. */
.network-logo-img { background: #fff; border: 1px solid var(--border); overflow: hidden; padding: 6px; }
.network-logo-img img { width: 100%; height: 100%; object-fit: contain; }

.network-tile-name { font-size: 11.5px; font-weight: 700; color: var(--text); }

.network-manual-toggle {
    display: flex; align-items: center; gap: 8px;
    margin-top: 10px; font-size: 13px; font-weight: 500; color: var(--text-muted);
    cursor: pointer;
}

.network-auto-hint {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    background: var(--accent-light); color: var(--accent-dark);
    padding: 9px 12px; border-radius: var(--radius-sm);
    margin-top: 10px; margin-bottom: 0;
}
.network-auto-hint .link-btn {
    background: none; border: none; padding: 0; margin: 0;
    color: var(--primary); font-weight: 700; font-size: 12.5px;
    text-decoration: underline; cursor: pointer; font-family: inherit;
}

.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-dark); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.grid { display: grid; gap: 18px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.section { padding: 64px 0; }
.section-sm { padding: 32px 0; }

/* ---------------------------------------------------------------------
   Brand loader - small animated "searching" logo shown while a service opens
   --------------------------------------------------------------------- */

.brand-loader {
    position: fixed; inset: 0; z-index: 9999;
    display: none; align-items: center; justify-content: center; flex-direction: column; gap: 14px;
    background: rgba(238, 241, 251, 0.88);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.brand-loader.is-visible { display: flex; animation: brand-loader-in 0.18s ease-out; }
.brand-loader-orbit { position: relative; width: 92px; height: 92px; display: flex; align-items: center; justify-content: center; }
.brand-loader-orbit::before {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    border: 3px solid transparent; border-top-color: var(--accent); border-right-color: var(--primary-light);
    animation: brand-loader-spin 1.2s linear infinite;
}
.brand-loader-orbit::after {
    content: ""; position: absolute; inset: 4px; border-radius: 50%;
    background: var(--primary-light); opacity: 0.12; animation: brand-loader-pulse 1.6s ease-in-out infinite;
}
.brand-loader-tile {
    position: relative; z-index: 1; width: 58px; height: 58px; border-radius: 18px; background: #fff;
    box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center;
}
.brand-loader-tile img { width: 40px; height: 40px; object-fit: contain; }
.brand-loader-text { color: var(--text-muted); font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; }

@keyframes brand-loader-spin { to { transform: rotate(360deg); } }
@keyframes brand-loader-pulse { 0%, 100% { transform: scale(0.9); opacity: 0.16; } 50% { transform: scale(1.1); opacity: 0.04; } }
@keyframes brand-loader-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .brand-loader-orbit::before, .brand-loader-orbit::after { animation-duration: 3s; }
}

.auth-feature-list .icon-badge svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------------
   Phone field: phone icon, number, contact picker + recent numbers buttons
   --------------------------------------------------------------------- */
.phone-field {
    position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
    background: #f7f9fe; border: 1.5px solid var(--border); border-radius: 16px; padding: 0 14px; height: 58px;
}
.phone-field:focus-within { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(42, 58, 143, 0.12); }
.phone-field:has(.is-invalid) { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-light); }
.phone-field > svg.phone-field-icon { width: 22px; height: 22px; color: var(--text-muted); flex: none; }
.phone-field > input.form-control {
    flex: 1 1 auto; min-width: 0; width: auto; height: 100%; padding: 0; margin: 0;
    border: none; border-radius: 0; background: transparent; box-shadow: none;
    font-size: 18px; font-weight: 600; letter-spacing: 1px; color: var(--text);
}
.phone-field > input.form-control:focus { outline: none; box-shadow: none; }
.phone-field > input.form-control:disabled { opacity: 0.6; }
.phone-field-btn { flex: none; background: none; border: none; padding: 4px; cursor: pointer; color: var(--text-muted); display: flex; border-radius: 8px; }
.phone-field-btn:hover { color: var(--primary); background: rgba(22, 33, 92, 0.06); }
.phone-field-btn svg { width: 25px; height: 25px; }
.phone-recent {
    position: absolute; top: calc(100% + 8px); right: 0; left: 0; z-index: 50; background: var(--surface);
    border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; display: none;
}
.phone-recent.is-open { display: block; }
.phone-recent-title { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); padding: 6px 10px; }
.phone-recent button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none;
    padding: 11px 10px; border-radius: 10px; font-size: 15px; font-weight: 700; letter-spacing: 0.5px; cursor: pointer; color: var(--text); }
.phone-recent button:hover { background: var(--bg); }
.phone-recent-empty { padding: 10px; font-size: 13.5px; color: var(--text-muted); }

/* Floating WhatsApp support button (all pages) */
.wa-float {
    position: fixed; right: 18px; bottom: 22px; z-index: 550;
    width: 56px; height: 56px; border-radius: 50%; background: #25D366;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); transition: transform 0.15s ease;
}
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 30px; height: 30px; }
@media (max-width: 899px) { body:has(.bottom-nav) .wa-float { bottom: 92px; right: 14px; } }
.phone-field > input.form-control { font-size: 17px; letter-spacing: 0.5px; }
.phone-field > input.form-control::placeholder { font-weight: 500; color: #9aa3b8; letter-spacing: 1px; }

/* 4-digit PIN login pad */
.pin-dots { display: flex; justify-content: center; gap: 18px; margin: 4px 0 22px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #c4cbe0; display: block; }
.pin-dots i.on { background: var(--primary); border-color: var(--primary); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; justify-content: center; }
.pin-pad button {
    width: 72px; height: 72px; border-radius: 50%; border: none; background: #fff; color: var(--text);
    font-size: 26px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow);
    transition: transform 0.1s ease, background 0.1s ease;
}
.pin-pad button:active { transform: scale(0.94); background: var(--bg); }
.pin-pad button[data-back] { font-size: 22px; color: var(--text-muted); }
.pin-pad button.pin-go { font-size: 28px; color: var(--text-muted); }
.pin-pad button.pin-go.ready { color: var(--accent-dark); }
.pin-dots { flex-wrap: wrap; }

/* Avatar on the login card */
.auth-form-card .login-avatar {
    width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2a3a8f, #16215c); color: #fff; font-size: 34px; font-weight: 800;
    box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--accent), 0 14px 30px rgba(22, 33, 92, 0.25);
}
.auth-form-card .login-avatar.is-guest { background: #e6e9f6; color: var(--primary); box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--border); }
.auth-form-card .login-avatar svg { width: 40px; height: 40px; }
.auth-form-card:has(.login-avatar) h1, .auth-form-card:has(.login-avatar) > p { text-align: center; }

/* Login page: avatar picture, and everything on one phone screen */
.auth-form-card .login-avatar { overflow: hidden; }
.auth-form-card .login-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-form-card .login-avatar.is-user { background: linear-gradient(135deg, #2a3a8f, #16215c); color: #fff; }
@media (max-width: 860px) {
    .auth-section { padding: 10px 0 12px; min-height: 0; }
    .auth-form-panel { padding: 14px 20px 10px; }
    .auth-form-card .login-avatar { width: 64px; height: 64px; margin-bottom: 8px; }
    .auth-form-card .login-avatar svg { width: 30px; height: 30px; }
    .auth-form-card h1 { font-size: 20px; margin-bottom: 2px; }
    .auth-form-card .pin-dots { margin: 2px 0 12px; }
    .pin-pad { grid-template-columns: repeat(3, 62px); gap: 10px; }
    .pin-pad button { width: 62px; height: 62px; font-size: 22px; }
}
@media (max-width: 860px) and (max-height: 700px) {
    .pin-pad { grid-template-columns: repeat(3, 54px); gap: 8px; }
    .pin-pad button { width: 54px; height: 54px; font-size: 20px; }
}
@media (max-width: 860px) {
    /* Login/register pages: no footer, so the page fits one phone screen. */
    body:has(#pin-login-form) footer { display: none; }
    body:has(#pin-login-form) .auth-section { padding-top: 16px; }
    body:has(#pin-login-form) .auth-form-panel { padding-top: 18px; }
}
@media (max-width: 860px) {
    body:has(#pin-login-form) .auth-section { padding: 16px 0 0; }
    body:has(#pin-login-form) .auth-shell { box-shadow: none; background: transparent; }
    body:has(#pin-login-form) .auth-form-panel { padding: 6px 16px 0; }
    body:has(#pin-login-form) .login-avatar { width: 54px; height: 54px; margin-bottom: 6px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent); }
    body:has(#pin-login-form) .login-avatar svg { width: 26px; height: 26px; }
    body:has(#pin-login-form) .auth-form-card h1 { font-size: 19px; margin-bottom: 0; }
    body:has(#pin-login-form) .auth-form-card > p { font-size: 13px; margin-bottom: 8px !important; }
    body:has(#pin-login-form) .auth-form-card .form-group { margin-bottom: 8px; }
    body:has(#pin-login-form) .auth-form-card .form-control { padding: 9px 12px; }
    body:has(#pin-login-form) .auth-form-card .form-label { margin-bottom: 3px; font-size: 13px; }
    body:has(#pin-login-form) .pin-dots { margin: 0 0 8px; gap: 14px; }
    body:has(#pin-login-form) .pin-dots i { width: 12px; height: 12px; }
    body:has(#pin-login-form) .pin-pad { grid-template-columns: repeat(3, 52px); gap: 7px; }
    body:has(#pin-login-form) .pin-pad button { width: 52px; height: 52px; font-size: 20px; box-shadow: 0 3px 10px rgba(22,33,92,0.12); }
    body:has(#pin-login-form) .auth-form-card p.text-center { margin-top: 6px !important; font-size: 13px !important; }
    body:has(#pin-login-form) .wa-float { width: 46px; height: 46px; bottom: 82px; }
    body:has(#pin-login-form) .wa-float svg { width: 24px; height: 24px; }
    body:has(#pin-login-form) { padding-bottom: 0; }
}

/* ---- Login screen, modelled on the app's PIN screen ---- */
.auth-form-card { position: relative; text-align: center; }
.login-switch-icon { position: absolute; top: -6px; right: 0; color: var(--text-muted); padding: 6px; }
.login-switch-icon svg { width: 26px; height: 26px; display: block; }
.login-tile {
    width: 92px; height: 92px; border-radius: 28px; margin: 6px auto 16px; overflow: hidden;
    background: #0b1f4d; color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 16px 34px rgba(11, 31, 77, 0.38);
}
.login-tile svg { width: 40px; height: 40px; }
.login-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-hello { color: var(--text-muted); font-size: 16px; margin: 0; }
.login-name { font-size: 24px; font-weight: 800; color: #0b1633; margin: 2px 0 12px; }
.login-pill { display: inline-block; background: #0b1f4d; color: #fff; font-weight: 700; letter-spacing: 1px; font-size: 14px; padding: 8px 24px; border-radius: 999px; margin-bottom: 22px; min-width: 170px; }
.login-links { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin: 18px 0 0; font-size: 15px; }
.login-links a { color: var(--text-muted); text-decoration: underline; font-weight: 600; }
.pin-dots i { width: 18px; height: 18px; border-color: #c4d0e4; }
.pin-dots { gap: 24px; margin: 0 0 26px; }
.pin-pad { grid-template-columns: repeat(3, 84px); gap: 16px 26px; }
.pin-pad button { width: 84px; height: 84px; font-size: 30px; color: #0b1633; box-shadow: 0 10px 28px rgba(22, 33, 92, 0.12); }

@media (max-width: 860px) {
    body:has(#pin-login-form) { background: #fff; }
    body:has(#pin-login-form) .auth-shell { background: transparent; box-shadow: none; }
    body:has(#pin-login-form) .auth-form-panel { padding: 4px 16px 0; }
    body:has(#pin-login-form) .login-tile { width: clamp(60px, 11vh, 92px); height: clamp(60px, 11vh, 92px); border-radius: 26px; margin: 2px auto clamp(6px, 1.6vh, 16px); }
    body:has(#pin-login-form) .login-tile svg { width: 36px; height: 36px; }
    body:has(#pin-login-form) .login-name { font-size: clamp(19px, 3.2vh, 24px); margin-bottom: clamp(4px, 1.2vh, 12px); }
    body:has(#pin-login-form) .login-hello { font-size: 14px; }
    body:has(#pin-login-form) .login-pill { margin-bottom: clamp(8px, 2vh, 22px); padding: 6px 20px; font-size: 13px; }
    body:has(#pin-login-form) .pin-dots { margin-bottom: clamp(8px, 2vh, 24px); }
    body:has(#pin-login-form) .pin-dots i { width: 15px; height: 15px; }
    body:has(#pin-login-form) .pin-pad { grid-template-columns: repeat(3, clamp(50px, 9.4vh, 84px)); gap: clamp(7px, 1.6vh, 16px) clamp(16px, 3.6vh, 30px); }
    body:has(#pin-login-form) .pin-pad button { width: clamp(50px, 9.4vh, 84px); height: clamp(50px, 9.4vh, 84px); font-size: clamp(20px, 3.6vh, 30px); box-shadow: 0 6px 18px rgba(22,33,92,0.12); }
    body:has(#pin-login-form) .login-links { margin-top: clamp(8px, 1.8vh, 18px); gap: 20px; font-size: 14px; }
    body:has(#pin-login-form) .auth-form-card .form-group { margin-bottom: 8px; }
}
.mobile-menu:not(.is-open) { box-shadow: none; }
@media (max-width: 860px) {
    body:has(#pin-login-form) .auth-section { padding-top: 6px; }
    body:has(#pin-login-form) .pin-pad { grid-template-columns: repeat(3, clamp(46px, 8.6vh, 84px)); }
    body:has(#pin-login-form) .pin-pad button { width: clamp(46px, 8.6vh, 84px); height: clamp(46px, 8.6vh, 84px); }
    body:has(#pin-login-form) .login-tile { width: clamp(52px, 9vh, 92px); height: clamp(52px, 9vh, 92px); }
    body:has(#pin-login-form) .auth-form-card p.text-center { margin-top: 6px !important; }
}
@media (max-width: 860px) {
    body:has(#pin-login-form) .wa-float { top: 82px; left: 12px; right: auto; bottom: auto; width: 40px; height: 40px; }
    body:has(#pin-login-form) .wa-float svg { width: 22px; height: 22px; }
}

/* =====================================================================
   Design-system polish (applies to every page)
   ===================================================================== */
:focus-visible { outline: 3px solid rgba(91, 124, 255, 0.55); outline-offset: 2px; border-radius: 8px; }
.form-control:focus-visible, .btn:focus-visible { outline-offset: 1px; }

.form-control, select.form-control, textarea.form-control {
    border-radius: 14px; background: #fbfcff; padding: 13px 15px; min-height: 48px;
}
.form-control::placeholder { color: #9aa3b8; }
.form-control:disabled { background: #f1f3f9; color: var(--text-muted); cursor: not-allowed; }
.form-label { font-weight: 700; }

.btn { border-radius: 14px; min-height: 46px; letter-spacing: 0.01em; }
.btn-sm { min-height: 36px; border-radius: 11px; }
.btn-primary { box-shadow: 0 6px 16px rgba(0, 184, 107, 0.28); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(0, 184, 107, 0.32); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 3px 8px rgba(0, 184, 107, 0.25); }
.btn-secondary:hover, .btn-outline:hover { transform: translateY(-1px); }
.btn:disabled { box-shadow: none; transform: none; }

.card { border-radius: 20px; }
.modal { border-radius: 24px; animation: modal-pop 0.18s ease-out; }
@keyframes modal-pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

.badge { letter-spacing: 0.01em; }
.badge-warning { background: rgba(245, 185, 61, 0.16); color: #b87a00; }
.badge-success { color: #0a8f5f; }
.badge-danger { color: #d93a40; }

.alert { border-radius: 14px; }
.alert-success { color: #0a7a52; }

table th { letter-spacing: 0.05em; }
@media (max-width: 640px) {
    .card { padding: 18px; }
    .container { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
