﻿/* ============================================================
   auth.css — eparcare authentication styles
   ============================================================ */

:root {
    --bg-0: #F4F1E8;
    --bg-1: #FFFFFF;
    --bg-dark: #161A12;
    --bg-dark-2: #1F2419;
    --bg-dark-3: #2A2F22;
    --line: rgba(58, 50, 30, 0.08);
    --line-strong: rgba(58, 50, 30, 0.16);
    --line-dark: rgba(255, 248, 220, 0.08);
    --text: #1F2419;
    --text-2: #5A6051;
    --text-3: #8B907F;
    --text-on-dark: #F4F1E8;
    --text-on-dark-2: rgba(244, 241, 232, 0.7);
    --text-on-dark-3: rgba(244, 241, 232, 0.42);
    --accent: #5C6E37;
    --accent-2: #7A8E48;
    --accent-3: #3F4D24;
    --green: #6B8F3A;
    --green-bright: #8FB358;
    --amber: #D4A04E;
    --amber-bright: #E8B547;
    --red: #B84A3A;
    --font-display: 'Geist', system-ui, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, monospace;
    --ease: cubic-bezier(.2,.8,.2,1);
    --ease-out: cubic-bezier(.16,1,.3,1);
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-display);
    background: var(--bg-0);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input {
    font: inherit;
}

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

/* ── Top bar ─────────────────────────────────────────── */
.auth-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 22px 32px;
    display: flex;
    align-items: center;
    pointer-events: none;
}

    .auth-top > * {
        pointer-events: auto;
    }

.brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.brand-home {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: var(--accent);
    border-radius: 8px;
    position: relative;
    box-shadow: 0 2px 10px rgba(92,110,55,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}

    .brand-mark svg {
        width: 20px;
        height: 20px;
    }

    .brand-mark::after {
        content: "";
        position: absolute;
        bottom: 5px;
        right: 5px;
        width: 4.5px;
        height: 4.5px;
        background: var(--amber);
        border-radius: 50%;
        box-shadow: 0 0 8px rgba(212,160,78,0.7);
        animation: brandPulse 2.4s ease-in-out infinite;
    }

.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.04em;
    color: var(--text);
    line-height: 1;
}

    .brand-name .e {
        color: var(--accent);
    }

.brand-by {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    color: var(--text-3);
    margin-left: 42px;
    margin-top: 4px;
    text-transform: uppercase;
    font-weight: 500;
    transition: color .2s;
}

    .brand-by:hover {
        color: var(--text);
    }

/* ── Split layout ────────────────────────────────────── */
.auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
}

/* ── LEFT — form side ────────────────────────────────── */
.auth-side {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
}

    .auth-side::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(700px 500px at 30% 50%, rgba(212,160,78,0.08), transparent 60%), radial-gradient(500px 400px at 70% 90%, rgba(92,110,55,0.06), transparent 60%);
        pointer-events: none;
    }

    .auth-side::after {
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient(to right, rgba(58,50,30,0.025) 1px, transparent 1px), linear-gradient(to bottom, rgba(58,50,30,0.025) 1px, transparent 1px);
        background-size: 48px 48px;
        pointer-events: none;
        mask-image: radial-gradient(ellipse 70% 80% at 50% 50%, black 30%, transparent 80%);
    }

.auth-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
    animation: fadeUp 0.7s var(--ease-out);
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    margin-bottom: 14px;
    font-weight: 500;
}

    .auth-eyebrow .pulse {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--green);
        box-shadow: 0 0 8px var(--green);
        animation: livePulse 1.6s ease-in-out infinite;
    }

.auth-title {
    font-family: var(--font-display);
    font-size: clamp(34px, 4.5vw, 46px);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.0;
    color: var(--text);
    margin-bottom: 14px;
}

    .auth-title .accent {
        background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 35%, var(--amber) 50%, var(--accent-2) 65%, var(--accent) 100%);
        background-size: 250% 100%;
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
        font-weight: 500;
        animation: gradientFlow 8s ease-in-out infinite;
    }

.auth-sub {
    color: var(--text-2);
    font-size: 15px;
    margin-bottom: 36px;
    line-height: 1.55;
}

/* ── Form elements ───────────────────────────────────── */
.form-error {
    display: none;
    margin-bottom: 16px;
    padding: 11px 14px;
    background: rgba(184,74,58,0.06);
    border: 1px solid rgba(184,74,58,0.22);
    border-radius: 10px;
    font-size: 13px;
    color: var(--red);
    line-height: 1.45;
}

    .form-error.is-shown {
        display: block;
        animation: shake 0.4s var(--ease);
    }

.form-group {
    margin-bottom: 14px;
    position: relative;
}

    .form-group label {
        display: block;
        font-family: var(--font-mono);
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.15em;
        color: var(--text-3);
        margin-bottom: 7px;
        font-weight: 500;
    }

.input-wrap {
    position: relative;
}

    .input-wrap svg.leading {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-3);
        transition: color .2s;
        pointer-events: none;
    }

    .input-wrap input {
        width: 100%;
        padding: 12px 14px 12px 42px;
        background: var(--bg-1);
        border: 1px solid var(--line-strong);
        border-radius: 10px;
        font-family: var(--font-display);
        font-size: 14px;
        color: var(--text);
        transition: all .2s var(--ease);
    }

        .input-wrap input::placeholder {
            color: var(--text-3);
        }

        .input-wrap input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(92,110,55,0.12), 0 4px 12px rgba(92,110,55,0.08);
        }

            .input-wrap input:focus ~ svg.leading {
                color: var(--accent);
            }

        .input-wrap input.is-invalid {
            border-color: var(--red);
        }

.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    color: var(--text-3);
    transition: color .2s, background .2s;
}

    .toggle-pw:hover {
        color: var(--text);
        background: rgba(58,50,30,0.06);
    }

/* Remember + forgot */
.form-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    margin-bottom: 22px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
}

    .remember input {
        display: none;
    }

    .remember .box {
        width: 16px;
        height: 16px;
        border: 1.5px solid var(--line-strong);
        border-radius: 4px;
        background: var(--bg-1);
        display: grid;
        place-items: center;
        transition: all .2s;
    }

    .remember input:checked + .box {
        background: var(--accent);
        border-color: var(--accent);
    }

    .remember .box svg {
        opacity: 0;
        color: white;
        transition: opacity .15s;
    }

    .remember input:checked + .box svg {
        opacity: 1;
    }

.forgot {
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
    transition: color .2s;
}

    .forgot:hover {
        color: var(--accent-3);
        text-decoration: underline;
    }

/* Submit button */
.submit-btn {
    width: 100%;
    padding: 13px;
    background: var(--accent);
    color: #FFFFFF;
    border-radius: 11px;
    font-family: var(--font-display);
    font-size: 14.5px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    transition: all .25s var(--ease);
    box-shadow: 0 2px 8px rgba(92,110,55,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .submit-btn::before {
        content: "";
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
        transition: left 0.6s var(--ease);
    }

    .submit-btn:hover::before {
        left: 100%;
    }

    .submit-btn:hover {
        background: var(--accent-3);
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(92,110,55,0.35);
    }

    .submit-btn:disabled {
        opacity: 0.7;
        cursor: wait;
        transform: none;
    }

    .submit-btn .arrow {
        transition: transform .2s;
        position: relative;
        z-index: 1;
    }

    .submit-btn:hover .arrow {
        transform: translateX(3px);
    }

    .submit-btn .label {
        position: relative;
        z-index: 1;
    }

    .submit-btn .spinner {
        display: none;
        width: 16px;
        height: 16px;
        border: 2px solid rgba(255,255,255,0.25);
        border-top-color: white;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

    .submit-btn.is-loading .label,
    .submit-btn.is-loading .arrow {
        display: none;
    }

    .submit-btn.is-loading .spinner {
        display: block;
    }

/* Last login */
.last-login {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-3);
    letter-spacing: 0.04em;
}

    .last-login .dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--green);
        box-shadow: 0 0 6px var(--green);
    }

.auth-helper {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-2);
}

    .auth-helper a {
        color: var(--accent);
        font-weight: 500;
    }

        .auth-helper a:hover {
            text-decoration: underline;
        }

/* ── RIGHT — live system side ────────────────────────── */
.system-side {
    position: relative;
    background: var(--bg-dark);
    color: var(--text-on-dark);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 76px 48px 48px;
}

    .system-side::before {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(800px 500px at 70% 30%, rgba(122,142,72,0.12), transparent 60%), radial-gradient(600px 400px at 30% 90%, rgba(212,160,78,0.06), transparent 60%);
        pointer-events: none;
    }

    .system-side::after {
        content: "";
        position: absolute;
        inset: 0;
        background-image: linear-gradient(to right, rgba(212,200,160,0.04) 1px, transparent 1px), linear-gradient(to bottom, rgba(212,200,160,0.04) 1px, transparent 1px);
        background-size: 32px 32px;
        pointer-events: none;
        mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 90%);
    }

.sys-head {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.sys-head-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-on-dark-2);
}

    .sys-head-label .pulse {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--green-bright);
        box-shadow: 0 0 10px var(--green-bright);
        animation: livePulse 1.6s ease-in-out infinite;
    }

.sys-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-on-dark-3);
    letter-spacing: 0.06em;
}

.sys-title {
    position: relative;
    z-index: 2;
    font-family: var(--font-display);
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-on-dark);
    margin-bottom: 4px;
}

    .sys-title .accent {
        color: var(--amber-bright);
    }

.sys-sub {
    position: relative;
    z-index: 2;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-on-dark-3);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 28px;
}

/* Stats strip */
.sys-stats {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.sys-stat {
    background: rgba(255,248,220,0.03);
    border: 1px solid var(--line-dark);
    border-radius: 10px;
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
}

.sys-stat-label {
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-on-dark-3);
    margin-bottom: 6px;
}

.sys-stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.03em;
    color: var(--text-on-dark);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

    .sys-stat-value .unit {
        font-size: 12px;
        color: var(--text-on-dark-3);
        font-weight: 500;
        margin-left: 2px;
    }

.sys-stat-spark {
    position: absolute;
    bottom: 6px;
    right: 8px;
    height: 18px;
    width: 50px;
    opacity: 0.6;
}

/* Parking lot */
.sys-lot {
    position: relative;
    z-index: 2;
    flex: 1;
    background: rgba(0,0,0,0.18);
    border: 1px solid var(--line-dark);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .sys-lot svg {
        width: 100%;
        height: 100%;
        max-height: 320px;
    }

.spot {
    fill: rgba(255,248,220,0.04);
    stroke: rgba(212,200,160,0.18);
    stroke-width: 1;
}

.spot-num {
    fill: rgba(244,241,232,0.25);
    font-family: 'Geist Mono', monospace;
    font-size: 6px;
}

.car {
    fill: var(--accent-2);
    transition: fill .4s ease, opacity .4s ease;
}

    .car.entering {
        animation: carEnter 1s var(--ease-out) forwards;
    }

    .car.leaving {
        animation: carLeave 0.8s var(--ease) forwards;
    }

.lane {
    fill: rgba(0,0,0,0.25);
}

.lane-line {
    stroke: rgba(212,160,78,0.4);
    stroke-width: 0.6;
    stroke-dasharray: 3 3;
}

.barrier {
    stroke: var(--text-on-dark-2);
    stroke-width: 1.5;
    stroke-linecap: round;
    transform-origin: var(--bx, 0) var(--by, 0);
    transition: transform .8s var(--ease);
}

    .barrier.open {
        transform: scaleX(0.05);
    }

.scan-beam {
    fill: var(--amber-bright);
    opacity: 0;
    animation: scanBeam 4s ease-in-out infinite;
}

/* Event log */
.sys-log {
    position: relative;
    z-index: 2;
    background: rgba(0,0,0,0.22);
    border: 1px solid var(--line-dark);
    border-radius: 10px;
    padding: 14px 16px;
    height: 132px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 11px;
}

.sys-log-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line-dark);
}

.sys-log-title {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-on-dark-3);
}

.sys-log-stream {
    font-size: 9px;
    color: var(--green-bright);
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .sys-log-stream .stream-dot {
        width: 5px;
        height: 5px;
        background: var(--green-bright);
        border-radius: 50%;
        animation: livePulse 1.2s ease-in-out infinite;
    }

.sys-log-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: calc(100% - 30px);
    overflow: hidden;
}

    .sys-log-list li {
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--text-on-dark-2);
        letter-spacing: 0.04em;
        white-space: nowrap;
        animation: logIn 0.4s var(--ease-out);
    }

    .sys-log-list .ts {
        color: var(--text-on-dark-3);
        font-size: 10px;
    }

    .sys-log-list .plate {
        background: rgba(255,248,220,0.06);
        padding: 2px 6px;
        border-radius: 3px;
        color: var(--text-on-dark);
        font-weight: 600;
        letter-spacing: 0.05em;
    }

    .sys-log-list .action.granted {
        color: var(--green-bright);
    }

    .sys-log-list .action.denied {
        color: var(--red);
    }

    .sys-log-list .action.payment {
        color: var(--amber-bright);
    }

    .sys-log-list .action.exit {
        color: var(--text-on-dark-2);
    }

/* ── Keyframes ───────────────────────────────────────── */
@keyframes brandPulse {
    0%, 100% {
        opacity: 0.85;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.12);
        box-shadow: 0 0 14px rgba(212,160,78,0.9);
    }
}

@keyframes livePulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }
}

@keyframes gradientFlow {
    0%, 100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

@keyframes carEnter {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes carLeave {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateX(8px);
    }
}

@keyframes scanBeam {
    0%, 90%, 100% {
        opacity: 0;
    }

    92%, 96% {
        opacity: 0.8;
    }
}

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

@keyframes logIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
    body {
        overflow: auto;
    }

    .auth-split {
        grid-template-columns: 1fr;
        height: auto;
    }

    .auth-side {
        padding: 96px 24px 48px;
        min-height: 100vh;
    }

    .system-side {
        padding: 32px 24px;
        min-height: 60vh;
    }

    .auth-top {
        padding: 16px 20px;
    }

    .brand-by {
        display: none;
    }

    .sys-stats {
        gap: 8px;
    }

    .sys-stat {
        padding: 10px 12px;
    }

    .sys-stat-value {
        font-size: 18px;
    }

    .sys-log {
        height: 110px;
    }
}

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