@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
    --bg: #f4f8fb;
    --surface: #ffffff;
    --surface-elevated: rgba(255, 255, 255, 0.93);
    --border-soft: #d8e1ea;
    --border-strong: #b8c7d6;
    --text-strong: #12253a;
    --text-muted: #5f7388;
    --accent: #0f766e;
    --accent-soft: #e0f2f1;
    --warning: #b45309;
    --danger: #b91c1c;

    --auth-bg-start: #060d1f;
    --auth-bg-mid: #0f172a;
    --auth-bg-end: #1a1040;
    --auth-brand: #6272f3;
    --auth-brand-rgb: 98, 114, 243;
    --auth-accent: #34d399;
    --auth-text: #dce6ff;
    --auth-muted: #94a3b8;

    --auth-page-pad-desktop: 2.8rem;
    --auth-page-pad-tablet: 1.2rem;
    --auth-page-pad-mobile: 1rem;

    --auth-logo-size-desktop: 4.2rem;
    --auth-logo-size-mobile: 3.25rem;
    --auth-logo-partner-size: 1.35rem;
    --auth-logo-partner-size-mobile: 1.22rem;
    --auth-logo-partner: #9eb6df;

    --font-dashboard: "Plus Jakarta Sans", "Space Grotesk", "Segoe UI", sans-serif;

    /* ── Dashboard typography scale ───────────────────────────────
       Use these instead of hardcoded rem values across all pages.
       --dashboard-text-2xs : chart axes, truly tiny data labels
       --dashboard-text-xs  : uppercase labels, chips, captions
       --dashboard-text-sm  : secondary/meta text, notes, actions
       --dashboard-text-base: primary body / row text
       --dashboard-text-md  : section/panel headings (h2 level)
       --dashboard-text-lg  : KPI / metric values
       --dashboard-text-xl  : hero metric values
    ─────────────────────────────────────────────────────────────── */
    --dashboard-text-2xs:  0.61rem;
    --dashboard-text-xs:   0.68rem;
    --dashboard-text-sm:   0.72rem;
    --dashboard-text-base: 0.77rem;
    --dashboard-text-md:   0.92rem;
    --dashboard-text-lg:   1.24rem;
    --dashboard-text-xl:   1.36rem;
}

.auth-shell {
    width: 100%;
    min-height: 100vh;
    color: var(--auth-text);
    font-family: var(--font-dashboard);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: #d6e4ff;
    width: fit-content;
}

.auth-brand-logo {
    width: var(--auth-logo-size-desktop);
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(19, 35, 96, 0.38));
}

.auth-brand-partner {
    font-size: var(--auth-logo-partner-size);
    letter-spacing: 0.01em;
    color: var(--auth-logo-partner);
    font-weight: 640;
    line-height: 1;
}

.auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    border-radius: 999px;
    border: 1px solid rgba(var(--auth-brand-rgb), 0.2);
    background: rgba(var(--auth-brand-rgb), 0.1);
}

.auth-pill-dot {
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 999px;
    background: var(--auth-accent);
}

.auth-pill-label {
    color: #9fb2ef;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    font-weight: 560;
    text-transform: uppercase;
}

.auth-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.15rem var(--auth-page-pad-desktop);
}

.auth-main {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 2.4rem var(--auth-page-pad-desktop) 3rem;
}

.auth-main-split {
    min-height: clamp(40rem, 44vw, 42rem);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 1rem;
}

.auth-main-primary,
.auth-main-secondary {
    min-width: 0;
}

@media (max-width: 680px) {
    .auth-brand-logo {
        width: var(--auth-logo-size-mobile);
    }

    .auth-brand-partner {
        font-size: var(--auth-logo-partner-size-mobile);
    }
}

@media (max-width: 1080px) {
    .auth-topbar {
        padding: 1rem var(--auth-page-pad-tablet);
    }

    .auth-main {
        padding: 1.25rem var(--auth-page-pad-tablet) 2rem;
    }

    .auth-main-split {
        min-height: 0;
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    font-family: "Segoe UI Variable", "Bahnschrift", "Trebuchet MS", "Verdana", sans-serif;
    background:
        radial-gradient(circle at 12% -10%, #d7f0ee 0%, transparent 38%),
        radial-gradient(circle at 84% 6%, #ffe7cf 0%, transparent 28%),
        var(--bg);
    color: var(--text-strong);
    -webkit-user-select: none;
    user-select: none;
}

html.partner-layout-scroll-locked,
body.partner-layout-scroll-locked {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

input,
textarea,
select,
option,
[contenteditable="true"],
[contenteditable="plaintext-only"] {
    -webkit-user-select: text;
    user-select: text;
}

a,
.btn-link {
    color: var(--accent);
}

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

h1,
h2,
h3 {
    margin: 0;
    color: var(--text-strong);
}

.page-shell {
    display: grid;
    gap: 1rem;
}

.page-header {
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    background: var(--surface);
    padding: 1rem 1.2rem;
}

.page-header h1 {
    font-size: 1.42rem;
    margin-top: 0.3rem;
}

.page-header p {
    margin: 0.45rem 0 0;
    color: var(--text-muted);
}

.route-pill {
    display: inline-flex;
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--warning);
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.status-card {
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    background: var(--surface);
    padding: 1rem 1.15rem;
}

.status-card-warning {
    background: #fffaf2;
    border-color: #f3d4ad;
}

.status-card h2 {
    font-size: 1rem;
    margin-bottom: 0.7rem;
}

.status-list {
    margin: 0;
    padding-left: 1rem;
    display: grid;
    gap: 0.4rem;
    color: var(--text-muted);
}

.status-note {
    margin: 0;
    color: var(--text-muted);
}

.status-note strong {
    color: var(--danger);
}

.status-links {
    margin: 0;
    padding-left: 1rem;
    display: grid;
    gap: 0.35rem;
}

.status-links a {
    text-decoration: none;
}

.status-links a:hover {
    text-decoration: underline;
}

.action-row {
    margin-top: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.8rem;
    border-radius: 0.6rem;
    border: 1px solid #0f766e;
    background: #0f766e;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
}

.action-link:hover {
    background: #115e59;
    border-color: #115e59;
}

.action-link-muted {
    background: transparent;
    color: #0f766e;
}

.action-link-muted:hover {
    background: #e0f2f1;
}

.status-kv {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.45rem 0.7rem;
    margin: 0 0 0.85rem;
}

.status-kv dt {
    color: var(--text-muted);
}

.status-kv dd {
    margin: 0;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: #f8fbff;
    font-size: 0.82rem;
}

.status-pre {
    margin: 0.45rem 0 0;
    padding: 0.6rem;
    border-radius: 0.6rem;
    border: 1px solid var(--border-soft);
    background: #f8fbff;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
}

details {
    margin-top: 0.7rem;
}

details summary {
    cursor: pointer;
    color: var(--text-strong);
    font-weight: 600;
}

@media (max-width: 980px) {
    .status-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Global toggle switch ─────────────────────────────────────── */
.ui-toggle-shell {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}

.ui-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ui-toggle-switch {
    position: relative;
    width: 2.2rem;
    height: 1.24rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    background: rgba(51, 65, 85, 0.75);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ui-toggle-switch::after {
    content: "";
    position: absolute;
    top: 0.08rem;
    left: 0.1rem;
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 999px;
    background: #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.4);
    transition: transform 0.2s ease, background 0.2s ease;
}

.ui-toggle-input:checked + .ui-toggle-switch {
    border-color: rgba(98, 114, 243, 0.6);
    background: rgba(98, 114, 243, 0.32);
}

.ui-toggle-input:checked + .ui-toggle-switch::after {
    transform: translateX(0.95rem);
    background: #c7d2fe;
}

.ui-toggle-input:disabled + .ui-toggle-switch {
    opacity: 0.58;
    cursor: not-allowed;
}

.ui-toggle-input:focus-visible + .ui-toggle-switch {
    outline: 2px solid rgba(191, 219, 254, 0.66);
    outline-offset: 2px;
}
