/* ============================================================
   Auth design system — landing page + partner/admin login.
   Brand: navy #020659 · teal #037F8C · green #3C8C03 ·
          orange #D96704 · ink #0D0D0D · Poppins
   Used by: index.html, partner_login.html, admin_login.html
   ============================================================ */

:root {
    --navy:   #020659;
    --teal:   #037F8C;
    --green:  #3C8C03;
    --orange: #D96704;
    --ink:    #0D0D0D;

    /* Derived state shades (darkened brand values, not new hues) */
    --orange-deep: #b85603;     /* orange hover/active */
    --teal-deep:   #02646e;     /* teal hover */

    /* Neutrals (navy-tinted grays for light surfaces) */
    --surface:     #ffffff;
    --line:        #dcdfe9;
    --line-strong: #c3c8d8;
    --muted:       #5b5f74;

    /* Functional (non-brand by necessity) */
    --error:      #c62828;
    --error-bg:   #fdecea;
    --success-bg: #eef6e8;

    /* Scale */
    --radius-s: 8px;
    --radius-m: 12px;
    --radius-l: 18px;
    --shadow-card: 0 18px 44px -16px rgba(2, 6, 89, .16), 0 2px 10px rgba(2, 6, 89, .06);
    --ring-teal: 0 0 0 4px rgba(3, 127, 140, .22);

    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Poppins', -apple-system, 'Segoe UI', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1100px 560px at 82% -12%, rgba(3, 127, 140, .07), transparent 62%),
        radial-gradient(820px 480px at 8% 112%, rgba(60, 140, 3, .05), transparent 60%),
        #f4f6fb;
    background-attachment: fixed;
}

.auth-page ::selection { background: var(--teal); color: #fff; }

/* Visible focus everywhere, keyboard-friendly */
.auth-page a:focus-visible,
.auth-page button:focus-visible,
.auth-page input:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 2px;
    border-radius: var(--radius-s);
}

/* ── Top bar ──────────────────────────────────────────────── */

.site-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-5) clamp(20px, 5vw, 56px);
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .2px;
    color: var(--navy);
    text-decoration: none;
}

.wordmark .mark-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
}

.ghost-link {
    color: #80859b;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--radius-s);
    transition: color .15s, background .15s;
}

.ghost-link:hover {
    color: var(--navy);
    background: rgba(2, 6, 89, .06);
}

/* ── Landing hero ─────────────────────────────────────────── */

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--sp-7) clamp(20px, 5vw, 56px);
    max-width: 880px;
    margin: 0 auto;
    width: 100%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--navy);
    background: #fff;
    border: 1px solid #e2e6f1;
    border-radius: 999px;
    padding: 8px 16px;
    margin-bottom: var(--sp-6);
    box-shadow: 0 2px 8px rgba(2, 6, 89, .06);
}

.hero-badge svg { color: var(--green); }

.hero h1 {
    font-size: clamp(40px, 7.5vw, 68px);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -1.5px;
    color: var(--navy);
    margin-bottom: var(--sp-5);
}

.hero h1 .accent {
    color: transparent;
    background: linear-gradient(100deg, #54a812, var(--green) 70%);
    -webkit-background-clip: text;
    background-clip: text;
}

.hero .sub {
    font-size: clamp(16px, 2.4vw, 19px);
    font-weight: 400;
    line-height: 1.6;
    color: var(--muted);
    max-width: 520px;
    margin-bottom: var(--sp-7);
}

.secure-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: var(--sp-4);
    font-size: 13px;
    color: #8a8fa3;
}

.secure-note svg { flex-shrink: 0; color: #a3a8bb; }

.props {
    list-style: none;
    display: flex;
    gap: clamp(16px, 4vw, 44px);
    margin-top: var(--sp-8);
    flex-wrap: wrap;
    justify-content: center;
}

.props li {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 500;
    color: #4a4f66;
}

.props svg { color: var(--green); flex-shrink: 0; }

/* ── Footer ───────────────────────────────────────────────── */

.site-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: var(--sp-5) clamp(20px, 5vw, 56px);
    font-size: 12.5px;
    color: #9aa0b5;
    flex-wrap: wrap;
}

/* ── Primary CTA (one per page) ───────────────────────────── */

.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--teal);
    color: #fff;
    /* white on #037F8C = 4.75:1, passes AA at any size */
    font-size: 19px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: .2px;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-m);
    padding: 17px 40px;
    cursor: pointer;
    box-shadow: 0 14px 34px -10px rgba(3, 127, 140, .55);
    transition: background .15s, transform .15s, box-shadow .15s;
}

.btn-cta:hover {
    background: var(--teal-deep);
    transform: translateY(-2px);
    box-shadow: 0 18px 38px -10px rgba(3, 127, 140, .65);
}

.btn-cta:active {
    transform: translateY(0);
    box-shadow: 0 8px 22px -8px rgba(3, 127, 140, .55);
}

.btn-cta:disabled,
.btn-cta.is-loading {
    background: var(--teal-deep);
    opacity: .75;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-page .btn-cta:focus-visible {
    outline: 3px solid var(--navy);
    outline-offset: 2px;
}

.btn-cta .arrow { transition: transform .15s; }
.btn-cta:hover .arrow { transform: translateX(3px); }

.btn-cta--block { width: 100%; }

/* Loading spinner */
.btn-cta .spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin .7s linear infinite;
    flex-shrink: 0;
}

.btn-cta.is-loading .spinner { display: inline-block; }
.btn-cta.is-loading .arrow   { display: none; }

@keyframes authSpin { to { transform: rotate(360deg); } }

/* ── Login card ───────────────────────────────────────────── */

.auth-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--sp-6) 20px;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid #e7eaf3;
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-card);
    padding: clamp(28px, 6vw, 44px);
}

.card-head { margin-bottom: var(--sp-6); }

.card-head h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.4px;
    color: var(--navy);
    margin-bottom: var(--sp-2);
}

.card-head p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
}

/* ── Fields ───────────────────────────────────────────────── */

.field { margin-bottom: var(--sp-5); }

.field label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 7px;
}

.field .control { position: relative; }

.field input {
    width: 100%;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color .15s, box-shadow .15s;
}

.field input::placeholder { color: #9aa0b5; }

.field input:hover { border-color: var(--line-strong); }

.field input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: var(--ring-teal);
}

.field input:disabled {
    background: #f3f4f8;
    color: var(--muted);
    cursor: not-allowed;
}

.field.has-error input {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(198, 40, 40, .12);
}

.field .field-error {
    display: none;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--error);
    margin-top: 6px;
}

.field.has-error .field-error { display: block; }

/* Password show/hide toggle */
.toggle-pass {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    background: none;
    border: none;
    border-radius: var(--radius-s);
    color: var(--muted);
    cursor: pointer;
    transition: color .15s, background .15s;
}

.toggle-pass:hover { color: var(--navy); background: #f0f1f6; }

.field input[type="password"],
.field .control.has-toggle input { padding-right: 48px; }

/* Aux row: forgot password */
.aux-row {
    display: flex;
    justify-content: flex-end;
    margin: -10px 0 var(--sp-5);
}

.auth-card a.quiet-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--teal);
    text-decoration: none;
}

.auth-card a.quiet-link:hover {
    color: var(--teal-deep);
    text-decoration: underline;
}

/* Back link below card */
.below-card {
    margin-top: var(--sp-5);
    font-size: 13.5px;
}

.below-card a {
    color: var(--muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: var(--radius-s);
    transition: color .15s, background .15s;
}

.below-card a:hover { color: var(--navy); background: rgba(2, 6, 89, .06); }

/* ── Alerts (flash messages) ──────────────────────────────── */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: var(--sp-5);
}

.alert svg { flex-shrink: 0; margin-top: 1px; }

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(198, 40, 40, .25);
}

.alert-success {
    background: var(--success-bg);
    color: #2d6a02;
    border: 1px solid rgba(60, 140, 3, .3);
}

/* ── Responsive & motion ──────────────────────────────────── */

@media (max-width: 540px) {
    .props { flex-direction: column; align-items: flex-start; gap: 14px; }
    .hero  { padding-top: var(--sp-6); }
    .site-foot { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page *,
    .auth-page *::before,
    .auth-page *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
