/* Shared styles for the admin, staff and member login pages. */

:root {
    --ink: #0a0a0a;
    --ink-soft: #1c1c1c;
    --paper: #ffffff;
    --mist: #f4f4f5;
    --line: #e4e4e7;
    --muted: #71717a;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --success: #067647;
    --success-bg: #ecfdf3;
    --radius-card: 28px;
    --radius-pill: 999px;
    --shadow-btn: 0 10px 24px -10px rgba(10, 10, 10, 0.55);
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body.auth {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 960px) {
    body.auth {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    }
}

/* ---------- Brand panel ---------- */

.auth-brand {
    position: relative;
    overflow: hidden;
    background: var(--ink);
    color: var(--paper);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 24px 64px;
    isolation: isolate;
}

/* Fine grid + soft spotlight for depth, kept strictly monochrome. */
.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

.auth-brand::after {
    content: "";
    position: absolute;
    width: 620px;
    height: 620px;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.09), transparent 62%);
}

.auth-brand__logo {
    width: 132px;
    height: auto;
    display: block;
}

.auth-brand__copy {
    display: none;
    text-align: center;
    max-width: 420px;
}

.auth-brand__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.04);
}

.auth-brand__eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--paper);
}

.auth-brand__title {
    margin: 22px 0 12px;
    font-size: 44px;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.auth-brand__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
}

.auth-brand__foot {
    display: none;
    position: absolute;
    bottom: 28px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.38);
    letter-spacing: 0.02em;
}

@media (min-width: 960px) {
    .auth-brand {
        position: sticky;
        top: 0;
        height: 100vh;
        height: 100dvh;
        padding: 48px;
    }

    .auth-brand__logo {
        width: 230px;
        margin-bottom: 8px;
    }

    .auth-brand__copy,
    .auth-brand__foot {
        display: block;
    }
}

/* ---------- Form side ---------- */

/* On phones the white form area slides up over the black header. */
.auth-main {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-top: -32px;
    padding: 32px 20px 40px;
    background: var(--paper);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.auth-sheet {
    width: 100%;
    max-width: 440px;
    animation: rise 0.55s var(--ease) both;
}

@media (min-width: 960px) {
    .auth-main {
        align-items: center;
        margin-top: 0;
        padding: 48px 32px;
        border-radius: 0;
        min-height: 100vh;
        min-height: 100dvh;
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Portal switcher (segmented pill control) */
.auth-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 28px;
    background: var(--mist);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
}

.auth-switch a {
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-switch a:hover {
    color: var(--ink);
}

.auth-switch a[aria-current="page"] {
    background: var(--ink);
    color: var(--paper);
    box-shadow: 0 4px 12px -4px rgba(10, 10, 10, 0.5);
}

.auth-heading {
    margin: 0 0 6px;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-sub {
    margin: 0 0 28px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--muted);
}

/* ---------- Fields ---------- */

.field {
    margin-bottom: 16px;
}

.field__label {
    display: block;
    margin: 0 0 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

.field__control {
    position: relative;
}

.field__icon {
    position: absolute;
    left: 20px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: #a1a1aa;
    pointer-events: none;
    transition: color 0.2s;
}

.field__input {
    width: 100%;
    height: 54px;
    padding: 0 22px 0 50px;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    background: var(--mist);
    border: 1.5px solid transparent;
    border-radius: var(--radius-pill);
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.field__input::placeholder {
    color: #a1a1aa;
}

.field__input:hover {
    background: #ededef;
}

.field__input:focus {
    background: var(--paper);
    border-color: var(--ink);
    box-shadow: 0 0 0 4px rgba(10, 10, 10, 0.08);
}

.field__control:focus-within .field__icon {
    color: var(--ink);
}

.field__input.has-toggle {
    padding-right: 58px;
}

select.field__input {
    padding-right: 48px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230a0a0a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 22px center;
}

select.field__input:invalid {
    color: #a1a1aa;
}

.field__input.is-invalid {
    border-color: var(--danger);
    background: var(--danger-bg);
    animation: shake 0.3s;
}

@keyframes shake {
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.field__toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.field__toggle:hover,
.field__toggle:focus-visible {
    background: rgba(10, 10, 10, 0.06);
    color: var(--ink);
    outline: none;
}

.field__toggle svg {
    width: 18px;
    height: 18px;
}

.field__toggle .icon-hide,
.field__toggle[aria-pressed="true"] .icon-show {
    display: none;
}

.field__toggle[aria-pressed="true"] .icon-hide {
    display: block;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 12px;
}

@media (min-width: 520px) {
    .field-grid--2 {
        grid-template-columns: 1fr 1fr;
    }
}

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

.btn-pill {
    position: relative;
    width: 100%;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 28px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--ink);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s, color 0.2s;
}

.btn-pill svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s var(--ease);
}

.btn-pill--dark {
    background: var(--ink);
    color: var(--paper);
    box-shadow: var(--shadow-btn);
}

.btn-pill--dark:hover {
    transform: translateY(-1px);
    background: #000;
    box-shadow: 0 14px 28px -12px rgba(10, 10, 10, 0.7);
}

.btn-pill--dark:hover svg.arrow {
    transform: translateX(3px);
}

.btn-pill--light {
    background: var(--paper);
    color: var(--ink);
}

.btn-pill--light:hover {
    background: var(--ink);
    color: var(--paper);
}

.btn-pill:active {
    transform: translateY(0) scale(0.985);
}

.btn-pill:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(10, 10, 10, 0.18);
}

.btn-pill.is-loading {
    pointer-events: none;
    color: transparent;
}

.btn-pill.is-loading svg {
    opacity: 0;
}

.btn-pill.is-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--paper);
    animation: spin 0.8s linear infinite;
}

.btn-pill--light.is-loading::after {
    border-color: rgba(10, 10, 10, 0.2);
    border-top-color: var(--ink);
}

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

.btn-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    margin-top: 8px;
}

.btn-row .btn-pill--light {
    width: auto;
    padding: 0 22px;
}

.auth-actions {
    margin-top: 24px;
}

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

.alert-pill {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 13px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 500;
    animation: rise 0.35s var(--ease) both;
}

.alert-pill svg {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.alert-pill--error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecdca;
}

.alert-pill--success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #abefc6;
}

/* ---------- Misc ---------- */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 26px 0 18px;
    font-size: 13px;
    color: var(--muted);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.auth-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 20px 0 0;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
}

.auth-note svg {
    flex: none;
    width: 15px;
    height: 15px;
}

.auth-legal {
    margin: 32px 0 0;
    font-size: 12px;
    color: #a1a1aa;
    text-align: center;
}

.auth-panel[hidden] {
    display: none;
}

@media (max-width: 959px) {
    body { min-height: 100vh; min-height: 100dvh; }
    .auth-main { padding-top: max(24px, env(safe-area-inset-top)); padding-bottom: max(32px, env(safe-area-inset-bottom)); padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
    .field__input { min-height: 48px; font-size: 16px; }
    .field__toggle { min-width: 44px; min-height: 44px; }
    .auth-note, .auth-legal { line-height: 1.7; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
