/* Drug Gate — patient web design system (RTL, no build step) */
:root {
    /* ===== Drug Gate brand system v2 (light) ===== */
    --night: #081A45;
    --lapis: #1A3E8C;
    --pulse: #22CDB4;

    --brand: #159C89;          /* teal — primary actions */
    --brand-dark: #0f8577;
    --brand-darker: #0b6a5e;
    --brand-light: #c8ebe4;
    --brand-50: #e4f5f1;
    --accent: #1A3E8C;         /* lapis — secondary */
    --accent-dark: #12306e;
    --ink: #081A45;
    --muted: #5A6C96;
    --dim: #8A9BC4;
    --line: #D8E2F0;
    --bg: #F3F7FC;
    --card: #FFFFFF;
    --danger: #D64545;
    --warning: #C7912E;        /* gold */
    --info: #1A3E8C;
    --success: #159C89;
    --gold: #C7912E;
    --grad-brand: linear-gradient(150deg, #1A3E8C, #081A45);
    --radius: 14px;
    --shadow: 0 1px 3px rgba(8, 26, 69, .08), 0 1px 2px rgba(8, 26, 69, .04);
    --shadow-lg: 0 10px 30px rgba(8, 26, 69, .12);
    --shadow-xl: 0 24px 60px -12px rgba(8, 26, 69, .22);
    color-scheme: light;
}

/* ===== Dark mode ===== */
html[data-theme="dark"] {
    --brand: #22CDB4;
    --brand-dark: #1fb8a2;
    --brand-darker: #159C89;
    --brand-light: rgba(34, 205, 180, .22);
    --brand-50: rgba(34, 205, 180, .12);
    --accent: #7E9BE0;
    --accent-dark: #6f8fd8;
    --ink: #E8EEF9;
    --muted: #9FB2DE;
    --dim: #5F7BC0;
    --line: #1E3A78;
    --bg: #060F2E;
    --card: rgba(26, 62, 140, .15);
    --danger: #E36A6A;
    --warning: #E8B54A;
    --info: #7E9BE0;
    --success: #22CDB4;
    --gold: #E8B54A;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
    width: 100%;
    max-width: 1140px;
    margin-inline: auto;
    padding-inline: 18px;
}

/* Header / nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header .bar {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 66px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 800;
    color: var(--brand-dark);
}
.brand:hover { text-decoration: none; }
.brand .logo {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), var(--accent-dark));
    color: #fff; border-radius: 12px; font-size: 21px;
    box-shadow: 0 6px 16px -4px rgba(5, 150, 105, .5);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.3px; }
.brand-tag { font-size: .72rem; font-weight: 600; color: var(--muted); }
@media (max-width: 620px) { .brand-tag { display: none; } }
.nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-inline-start: auto;
    flex-wrap: wrap;
}
.nav a {
    color: var(--ink);
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .95rem;
}
.nav a:hover { background: var(--brand-50); color: var(--brand-dark); text-decoration: none; }
.nav a.active { background: var(--brand-light); color: var(--brand-dark); }

.bell { position: relative; }
.bell .dot {
    position: absolute; top: 2px; inset-inline-end: 4px;
    min-width: 18px; height: 18px; padding: 0 4px;
    background: var(--danger); color: #fff;
    font-size: 11px; font-weight: 700;
    border-radius: 999px; display: grid; place-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 11px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
    line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn-danger { background: var(--card); border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: .875rem; border-radius: 9px; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; border-radius: 13px; }
.btn-primary { box-shadow: 0 8px 20px -8px rgba(5, 150, 105, .6); }
.btn-white { background: #fff; color: var(--brand-dark); }
.btn-white:hover { background: #f0fdf4; color: var(--brand-darker); }
.btn-outline-white { background: transparent; border-color: rgba(255,255,255,.55); color: #fff; }
.btn-outline-white:hover { background: rgba(255,255,255,.14); color: #fff; border-color: #fff; }

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.card-hover { transition: .18s; }
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--brand-light); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Hero */
.hero {
    background: radial-gradient(1200px 500px at 100% -10%, var(--brand-light), transparent),
                radial-gradient(900px 500px at -10% 10%, #dbeafe, transparent);
    border-bottom: 1px solid var(--line);
    padding: 64px 0;
}
.hero h1 { font-size: 2.5rem; margin: 0 0 12px; letter-spacing: -.5px; }
.hero p { font-size: 1.15rem; color: var(--muted); margin: 0 0 26px; max-width: 620px; }
@media (max-width: 620px) { .hero h1 { font-size: 1.8rem; } }

/* Forms */
.field { margin-bottom: 16px; }
.label { display: block; font-weight: 700; margin-bottom: 7px; font-size: .92rem; }
.input, .select, .textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    font: inherit;
    background: var(--card);
    color: var(--ink);
    transition: .15s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-light);
}
.textarea { min-height: 92px; resize: vertical; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 5px; }
.error-text { color: var(--danger); font-size: .85rem; margin-top: 5px; }

/* Alerts */
.alert { padding: 13px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; border: 1px solid transparent; }
.alert-success { background: var(--brand-50); color: var(--brand-dark); border-color: var(--brand-light); }
.alert-error { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.alert-info { background: #eff6ff; color: var(--info); border-color: #bfdbfe; }

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px; border-radius: 999px;
    font-size: .8rem; font-weight: 700;
    background: #f1f5f9; color: var(--muted);
}
.badge-success { background: var(--brand-50); color: var(--brand-dark); }
.badge-warning { background: #fffbeb; color: var(--warning); }
.badge-info { background: #eff6ff; color: var(--info); }
.badge-danger { background: #fef2f2; color: var(--danger); }
.badge-gray { background: #f1f5f9; color: var(--muted); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); }
.table th { font-size: .82rem; color: var(--muted); font-weight: 700; text-transform: none; }
.table tbody tr:hover { background: var(--bg); }

/* Page title */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 30px 0 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.7rem; }

.section { padding: 34px 0; }

.muted { color: var(--muted); }
.center { text-align: center; }
.stack > * + * { margin-top: 14px; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.price { font-weight: 800; color: var(--brand-dark); }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* Auth split */
.auth-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 40px 18px; }
.auth-card { width: 100%; max-width: 440px; }

/* Empty state */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .ic { font-size: 44px; margin-bottom: 10px; }

/* Item rows for order builder */
.stock-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stock-row:last-child { border-bottom: 0; }
.stock-row .qty { width: 92px; }
.stock-row .name { flex: 1; }

/* Footer */
.site-footer { background: #0b1220; color: #cbd5e1; padding: 48px 0 0; margin-top: 60px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 34px; padding-bottom: 34px; }
.footer-brand p { color: #94a3b8; margin: 14px 0 0; max-width: 420px; line-height: 1.8; }
.footer-brand .brand .logo { box-shadow: none; }
.footer-col h4 { margin: 0 0 14px; font-size: 1rem; color: #fff; }
.footer-col a, .footer-col span { display: block; color: #94a3b8; margin-bottom: 9px; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.muted-light { color: #64748b !important; font-size: .82rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; color: #64748b; text-align: center; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 26px; } }

/* Pagination */
.pagination { display: flex; justify-content: center; margin-top: 10px; }
.pagination-links { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.page-btn {
    min-width: 40px; padding: 8px 12px; text-align: center;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--card); color: var(--ink); font-weight: 700;
}
.page-btn:hover { border-color: var(--brand); color: var(--brand-dark); text-decoration: none; }
.page-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.page-btn.disabled { color: #cbd5e1; background: #f8fafc; cursor: default; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding-inline-start: 26px; padding-bottom: 18px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 5px; top: 6px; width: 10px; height: 10px; border-radius: 999px; background: var(--brand); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 9px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }

/* ============================================================
   Landing page (premium)
   ============================================================ */
.hero-lux {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(900px 460px at 88% -8%, rgba(14, 165, 233, .16), transparent 60%),
        radial-gradient(760px 460px at 4% 8%, rgba(5, 150, 105, .16), transparent 60%),
        linear-gradient(180deg, #f6fdfb 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--line);
    padding: 72px 0 84px;
}
.hero-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; z-index: 0; }
.hero-blob-1 { width: 320px; height: 320px; background: rgba(16, 185, 129, .35); top: -80px; inset-inline-start: -60px; }
.hero-blob-2 { width: 300px; height: 300px; background: rgba(14, 165, 233, .3); bottom: -110px; inset-inline-end: 10%; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 44px; align-items: center; }
.hero-copy h1 { font-size: 3rem; line-height: 1.18; margin: 18px 0 16px; letter-spacing: -1px; font-weight: 800; }
.hero-copy > p { font-size: 1.18rem; color: var(--muted); margin: 0 0 28px; max-width: 560px; }
.grad-text { background: linear-gradient(120deg, var(--brand), var(--accent-dark)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 15px; border-radius: 999px;
    background: rgba(255,255,255,.75); border: 1px solid var(--brand-light);
    color: var(--brand-dark); font-weight: 700; font-size: .86rem;
    box-shadow: var(--shadow);
}
.pill-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--brand); box-shadow: 0 0 0 4px rgba(5,150,105,.18); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-trust { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 26px; }
.trust-item { color: var(--brand-dark); font-weight: 700; font-size: .9rem; }

.hero-visual { position: relative; height: 380px; }
.glass-card {
    position: absolute; display: flex; align-items: center; gap: 14px;
    padding: 16px 18px; width: 300px;
    background: rgba(255,255,255,.75); backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.9); border-radius: 18px;
    box-shadow: var(--shadow-xl);
}
.glass-card .gc-title { font-weight: 800; }
.glass-card .gc-sub { color: var(--muted); font-size: .84rem; }
.glass-card > div:nth-child(2) { flex: 1; }
.gc-icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-size: 24px; }
.gc-green { background: var(--brand-50); }
.gc-blue { background: #e0f2fe; }
.gc-amber { background: #fffbeb; }
.float-a { top: 18px; inset-inline-end: 0; animation: floaty 6s ease-in-out infinite; }
.float-b { top: 150px; inset-inline-start: 0; animation: floaty 6s ease-in-out infinite .8s; }
.float-c { bottom: 8px; inset-inline-end: 30px; animation: floaty 6s ease-in-out infinite 1.6s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; gap: 30px; }
    .hero-visual { height: 300px; max-width: 340px; }
}
@media (max-width: 620px) {
    .hero-lux { padding: 46px 0 56px; }
    .hero-copy h1 { font-size: 2.05rem; }
    .hero-copy > p { font-size: 1.05rem; }
    .hero-visual { display: none; }
}

/* Stats band */
.stats-band { background: linear-gradient(135deg, var(--brand-darker), var(--brand-dark)); padding: 34px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat-num { font-size: 2.3rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-num span { color: #6ee7b7; }
.stat-label { color: #a7f3d0; font-weight: 600; margin-top: 8px; font-size: .95rem; }
@media (max-width: 620px) { .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 26px; } }

/* Section head */
.section-head { margin-bottom: 34px; }
.section-head.center { text-align: center; }
.section-head h2 { font-size: 1.95rem; margin: 8px 0 0; letter-spacing: -.5px; }
.eyebrow { color: var(--brand); font-weight: 800; font-size: .82rem; letter-spacing: 1px; text-transform: uppercase; }
h2 { font-weight: 800; }

/* Feature cards */
.feature-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.feature-card h3 { margin: 16px 0 8px; font-size: 1.2rem; }
.feature-card p { margin: 0; }
.feature-ic { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; }
.feature-ic-green { background: var(--brand-50); }
.feature-ic-blue { background: #e0f2fe; }
.feature-ic-amber { background: #fffbeb; }

/* Steps */
.steps-section { background: linear-gradient(180deg, #fff, var(--bg)); border-block: 1px solid var(--line); }
.steps-grid { counter-reset: step; }
.step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px 26px 26px; box-shadow: var(--shadow); }
.step-num { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 1.25rem; color: #fff; background: linear-gradient(135deg, var(--brand), var(--accent-dark)); box-shadow: 0 8px 18px -6px rgba(5,150,105,.5); margin-bottom: 16px; }
.step h3 { margin: 0 0 8px; font-size: 1.15rem; }
.step p { margin: 0; }

/* Governorate cards */
.gov-card {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    text-align: center; padding: 22px 14px;
    background: var(--card); border: 1px solid var(--line); border-radius: 16px;
    box-shadow: var(--shadow); color: var(--ink);
}
.gov-card:hover { text-decoration: none; }
.gov-pin { font-size: 22px; }
.gov-name { font-weight: 800; font-size: 1.05rem; }
.link-arrow { color: var(--brand-dark); font-weight: 700; }

/* CTA banner */
.cta-banner {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
    background: linear-gradient(120deg, var(--brand-darker), var(--brand-dark) 55%, var(--accent-dark));
    border-radius: 24px; padding: 42px 44px; box-shadow: var(--shadow-xl);
}
.cta-blob { position: absolute; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.08); top: -120px; inset-inline-end: -60px; }
.cta-content { position: relative; z-index: 1; }
.cta-content h2 { color: #fff; margin: 0 0 8px; font-size: 1.7rem; }
.cta-content p { color: #d1fae5; margin: 0; font-size: 1.05rem; }
.cta-actions { position: relative; z-index: 1; display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 620px) { .cta-banner { padding: 32px 24px; } .cta-content h2 { font-size: 1.4rem; } }

/* =========================================================
   Brand system v2 — typography, dark-mode surfaces, toggle
   ========================================================= */
body { font-family: 'IBM Plex Sans Arabic', 'Cairo', "Segoe UI", Tahoma, sans-serif; }
h1, h2, h3, h4, .brand, .stat-num, .price { font-family: 'Noto Kufi Arabic', 'IBM Plex Sans Arabic', system-ui, sans-serif; }
.stat-num, .price { font-family: 'Space Grotesk', 'Noto Kufi Arabic', system-ui, sans-serif; }

/* Brand logo tile + footer = sanctioned lapis→night gradient / night */
.brand .logo { background: var(--grad-brand) !important; color: #fff; }
.site-footer { background: var(--night); }

/* Theme toggle */
.theme-toggle {
    display: inline-grid; place-items: center;
    width: 40px; height: 40px; border-radius: 11px;
    background: var(--card); border: 1px solid var(--line);
    color: var(--ink); cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, transform .18s;
}
.theme-toggle:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand-dark); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .ico-sun { display: none; }
html[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
html[data-theme="dark"] .theme-toggle .ico-moon { display: none; }

/* Dark-mode surface fixes for fixed light values */
html[data-theme="dark"] .site-header { background: rgba(6, 15, 46, .78); }
html[data-theme="dark"] .steps-section { background: linear-gradient(180deg, rgba(26,62,140,.12), var(--bg)); }
html[data-theme="dark"] .feature-ic-blue,
html[data-theme="dark"] .feature-ic-amber,
html[data-theme="dark"] .gc-blue,
html[data-theme="dark"] .gc-amber { background: rgba(255, 255, 255, .05); }
html[data-theme="dark"] .alert-error { background: rgba(214, 69, 69, .14); border-color: rgba(214, 69, 69, .4); }
html[data-theme="dark"] .alert-info { background: rgba(26, 62, 140, .2); border-color: var(--line); color: var(--accent); }
html[data-theme="dark"] .badge-warning { background: rgba(232, 181, 74, .16); color: var(--gold); }
html[data-theme="dark"] .badge-info { background: rgba(26, 62, 140, .25); color: var(--accent); }
html[data-theme="dark"] .badge-danger { background: rgba(214, 69, 69, .16); color: var(--danger); }
html[data-theme="dark"] .badge-gray { background: rgba(255, 255, 255, .06); color: var(--muted); }
html[data-theme="dark"] .pill { background: rgba(255, 255, 255, .05); }

/* =====================================================================
   Auth v2 — premium split-panel authentication pages
   ===================================================================== */
.auth2-wrap {
    min-height: calc(100vh - 66px);
    display: grid;
    place-items: center;
    padding: 46px 18px 64px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
.auth2-wrap::before,
.auth2-wrap::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .5;
    z-index: -1;
    animation: auth2-float 14s ease-in-out infinite alternate;
}
.auth2-wrap::before {
    width: 520px; height: 520px;
    background: radial-gradient(circle, var(--brand-light), transparent 65%);
    top: -180px; inset-inline-end: -120px;
}
.auth2-wrap::after {
    width: 460px; height: 460px;
    background: radial-gradient(circle, rgba(26, 62, 140, .25), transparent 65%);
    bottom: -160px; inset-inline-start: -120px;
    animation-delay: -7s;
}
@keyframes auth2-float {
    from { transform: translateY(0) scale(1); }
    to   { transform: translateY(40px) scale(1.08); }
}

.auth2-card {
    width: 100%;
    max-width: 980px;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: auth2-in .55s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes auth2-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Brand panel --- */
.auth2-brand {
    position: relative;
    overflow: hidden;
    background: var(--grad-brand);
    color: #fff;
    padding: 42px 36px;
    display: flex;
    flex-direction: column;
    gap: 26px;
}
.auth2-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(420px 300px at 110% -20%, rgba(34, 205, 180, .35), transparent 70%),
        radial-gradient(360px 300px at -20% 115%, rgba(34, 205, 180, .18), transparent 70%);
    pointer-events: none;
}
.auth2-brand::after {
    content: "";
    position: absolute;
    width: 210px; height: 210px;
    border: 1.5px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    bottom: -70px; inset-inline-end: -60px;
    box-shadow: 0 0 0 42px rgba(255, 255, 255, .045), 0 0 0 96px rgba(255, 255, 255, .025);
    pointer-events: none;
}
.auth2-brand > * { position: relative; z-index: 1; }
.auth2-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.25rem;
}
.auth2-logo .logo {
    width: 46px; height: 46px;
    display: grid; place-items: center;
    font-size: 1.35rem;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--pulse), #159C89);
    box-shadow: 0 10px 24px -8px rgba(34, 205, 180, .55);
}
.auth2-brand h2 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.45;
    letter-spacing: -.3px;
}
.auth2-brand .lead {
    margin: 8px 0 0;
    color: rgba(232, 238, 249, .85);
    font-size: .98rem;
}
.auth2-points {
    list-style: none;
    margin: auto 0 0;
    padding: 0;
    display: grid;
    gap: 13px;
}
.auth2-points li {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 600;
    font-size: .93rem;
    color: rgba(232, 238, 249, .92);
}
.auth2-points .pt-ic {
    flex: none;
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: rgba(34, 205, 180, .18);
    border: 1px solid rgba(34, 205, 180, .35);
    color: var(--pulse);
}
.auth2-points .pt-ic svg { width: 16px; height: 16px; }

/* --- Form panel --- */
.auth2-form { padding: 42px 40px 36px; }
.auth2-form h1 {
    margin: 0 0 6px;
    font-size: 1.55rem;
    letter-spacing: -.3px;
}
.auth2-form .sub { color: var(--muted); margin: 0 0 26px; font-size: .95rem; }

/* Inputs with leading icon */
.ig { position: relative; }
.ig .ig-ic {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: var(--dim);
    pointer-events: none;
    transition: color .15s;
}
.ig .ig-ic svg { width: 19px; height: 19px; }
.ig .input { padding-inline-start: 44px; }
.ig:focus-within .ig-ic { color: var(--brand); }

.auth2-form .input,
.auth2-form .select {
    padding-top: 13px;
    padding-bottom: 13px;
    border-radius: 13px;
    background: color-mix(in srgb, var(--card) 60%, var(--bg));
}
.auth2-form .input:focus,
.auth2-form .select:focus { background: var(--card); }
html[data-theme="dark"] .auth2-form .input,
html[data-theme="dark"] .auth2-form .select { background: rgba(8, 26, 69, .35); }
html[data-theme="dark"] .auth2-form .input:focus,
html[data-theme="dark"] .auth2-form .select:focus { background: rgba(8, 26, 69, .55); }

/* Password visibility toggle */
.ig .pw-toggle {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 34px; height: 34px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--dim);
    cursor: pointer;
    transition: .15s;
}
.ig .pw-toggle:hover { color: var(--brand); background: var(--brand-50); }
.ig .pw-toggle svg { width: 18px; height: 18px; }
.ig .pw-toggle .ic-eye-off { display: none; }
.ig .pw-toggle.on .ic-eye-off { display: block; }
.ig .pw-toggle.on .ic-eye { display: none; }
.ig input[type="password"] + .pw-toggle,
.ig .pw-toggle { z-index: 2; }
.ig.has-toggle .input { padding-inline-end: 46px; }

/* Phone row (dial code + number + optional send button) */
.phone-row { display: flex; gap: 9px; direction: ltr; }
.phone-row .select {
    flex: 0 0 138px;
    min-width: 0;
    direction: ltr;
    font-size: .92rem;
}
.phone-row .input {
    flex: 1;
    min-width: 0;
    direction: ltr;
    text-align: left;
    letter-spacing: .5px;
}
.phone-row .btn-otp {
    flex: none;
    white-space: nowrap;
    padding-inline: 16px;
    border-radius: 13px;
    font-size: .9rem;
}
@media (max-width: 460px) {
    .phone-row { flex-wrap: wrap; }
    .phone-row .select { flex: 1 1 42%; }
    .phone-row .input { flex: 1 1 52%; }
    .phone-row .btn-otp { flex: 1 1 100%; }
}

/* OTP code input */
.otp-input {
    direction: ltr;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 12px;
    font-variant-numeric: tabular-nums;
}
.otp-input::placeholder { letter-spacing: normal; font-size: .95rem; font-weight: 400; }

/* Submit button */
.btn-auth {
    width: 100%;
    padding: 14px 20px;
    font-size: 1.03rem;
    font-weight: 800;
    border-radius: 14px;
    border: 0;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--pulse) -30%, var(--brand) 55%, var(--brand-darker));
    box-shadow: 0 14px 30px -10px rgba(21, 156, 137, .55);
    transition: .18s;
}
.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -10px rgba(21, 156, 137, .65); filter: brightness(1.04); }
.btn-auth:active { transform: none; }

/* Meta row (remember / forgot) */
.auth2-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: .92rem;
}
.auth2-meta label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.auth2-meta input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); }
.auth2-meta a { font-weight: 700; }

.auth2-alt {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed var(--line);
    text-align: center;
    color: var(--muted);
    font-size: .93rem;
}
.auth2-alt a { font-weight: 800; }

.auth2-form .field { margin-bottom: 17px; }
.auth2-form .hint { font-size: .82rem; }
.err-text { color: var(--danger); font-size: .84rem; margin-top: 5px; font-weight: 600; }

/* OTP reveal step */
#otp-step { animation: auth2-in .4s cubic-bezier(.22, 1, .36, 1) both; }

/* Responsive: stack brand panel above the form */
@media (max-width: 880px) {
    .auth2-card { grid-template-columns: 1fr; max-width: 500px; }
    .auth2-brand { padding: 26px 26px 24px; gap: 12px; }
    .auth2-brand h2 { font-size: 1.25rem; }
    .auth2-brand .lead { font-size: .9rem; }
    .auth2-points { display: none; }
    .auth2-brand::after { display: none; }
    .auth2-form { padding: 28px 24px 26px; }
}
