:root {
    color-scheme: light;
    --auth-primary: #2457e6;
    --auth-primary-hover: #1d47c3;
    --auth-primary-soft: rgba(36, 87, 230, 0.10);
    --auth-accent: #f36d0b;
    --auth-success: #16a36a;
    --auth-danger: #d9485f;

    --auth-bg: #f4f6fb;
    --auth-surface: rgba(255, 255, 255, 0.94);
    --auth-surface-solid: #ffffff;
    --auth-surface-soft: #f7f9fc;
    --auth-text: #162033;
    --auth-text-muted: #687386;
    --auth-border: #dde3ec;
    --auth-input-bg: #fbfcfe;
    --auth-input-border: #d7deea;
    --auth-shadow: 0 24px 70px rgba(28, 39, 66, 0.14);
    --auth-focus: 0 0 0 4px rgba(36, 87, 230, 0.12);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --auth-primary: #6f8fff;
    --auth-primary-hover: #83a0ff;
    --auth-primary-soft: rgba(111, 143, 255, 0.13);
    --auth-accent: #ff8a35;
    --auth-success: #4fd49d;
    --auth-danger: #ff7589;

    --auth-bg: #0d1320;
    --auth-surface: rgba(20, 29, 45, 0.94);
    --auth-surface-solid: #141d2d;
    --auth-surface-soft: #182337;
    --auth-text: #f2f5fb;
    --auth-text-muted: #9aa7bc;
    --auth-border: #28364d;
    --auth-input-bg: #111a29;
    --auth-input-border: #314159;
    --auth-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
    --auth-focus: 0 0 0 4px rgba(111, 143, 255, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--auth-text);
    background:
        radial-gradient(circle at 8% 10%, rgba(36, 87, 230, 0.10), transparent 32rem),
        radial-gradient(circle at 94% 88%, rgba(243, 109, 11, 0.09), transparent 30rem),
        var(--auth-bg);
    overflow-x: hidden;
}

.auth-page::before,
.auth-page::after {
    content: "";
    position: fixed;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(4px);
    z-index: 0;
}

.auth-page::before {
    width: 290px;
    height: 290px;
    top: -150px;
    right: 8%;
    border: 1px solid rgba(36, 87, 230, 0.10);
}

.auth-page::after {
    width: 380px;
    height: 380px;
    bottom: -250px;
    left: -100px;
    border: 1px solid rgba(243, 109, 11, 0.10);
}

button,
input,
a {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.auth-layout {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 36px 0 28px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 22px;
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.theme-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    color: var(--auth-text-muted);
    background: var(--auth-surface);
    box-shadow: 0 8px 24px rgba(20, 32, 55, 0.06);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    transition: transform .18s ease, border-color .18s ease, color .18s ease, background-color .18s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--auth-primary) 38%, var(--auth-border));
    color: var(--auth-primary);
}

.theme-toggle:focus-visible,
.password-toggle:focus-visible,
.login-btn:focus-visible,
.login-footer a:focus-visible,
.developer-link:focus-visible {
    outline: none;
    box-shadow: var(--auth-focus);
}

.auth-shell {
    align-self: center;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(420px, 0.80fr);
    min-height: 610px;
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: 28px;
    background: var(--auth-surface);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(20px);
}

.auth-brand-panel {
    position: relative;
    padding: 58px 56px 52px;
    overflow: hidden;
    color: #ffffff;
    background:
        linear-gradient(145deg, rgba(15, 58, 159, .98), rgba(36, 87, 230, .96));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-brand-panel::before,
.auth-brand-panel::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-brand-panel::before {
    width: 360px;
    height: 360px;
    right: -210px;
    top: -100px;
}

.auth-brand-panel::after {
    width: 260px;
    height: 260px;
    left: -150px;
    bottom: -120px;
}

.brand-content,
.brand-meta {
    position: relative;
    z-index: 1;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    width: fit-content;
    padding: 8px 12px 8px 9px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(10px);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.brand-mark-icon {
    width: 27px;
    height: 27px;
    border-radius: 8px;
    background: #ffffff;
    display: grid;
    place-items: center;
    color: var(--auth-accent);
    font-size: 13px;
}

.brand-title {
    max-width: 510px;
    margin: 34px 0 15px;
    font-size: clamp(34px, 4vw, 50px);
    line-height: 1.04;
    letter-spacing: -0.045em;
    font-weight: 760;
}

.brand-title span {
    color: #ffb16f;
}

.brand-description {
    max-width: 485px;
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 15px;
    line-height: 1.75;
}

.brand-features {
    display: grid;
    gap: 14px;
    margin-top: 40px;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 13px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    font-weight: 520;
}

.brand-feature i {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
}

.brand-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
}

.brand-meta-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #75e8b9;
    box-shadow: 0 0 0 5px rgba(117, 232, 185, 0.12);
}

.auth-form-panel {
    padding: 54px 56px 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--auth-surface-solid);
}

.login-header {
    margin-bottom: 26px;
}

.login-logo-wrap {
    height: 92px;
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.login-logo {
    width: 168px;
    height: 112px;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.login-eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--auth-primary);
    font-size: 12px;
    font-weight: 760;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.login-title {
    margin: 0;
    color: var(--auth-text);
    font-size: 29px;
    line-height: 1.15;
    letter-spacing: -0.035em;
    font-weight: 740;
}

.login-subtitle {
    margin: 9px 0 0;
    color: var(--auth-text-muted);
    font-size: 14px;
    line-height: 1.55;
}

.business-hours-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--auth-success) 32%, var(--auth-border));
    border-radius: 13px;
    background: color-mix(in srgb, var(--auth-success) 8%, transparent);
}

.business-status {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.business-status-icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--auth-success);
    background: color-mix(in srgb, var(--auth-success) 12%, transparent);
    font-size: 12px;
}

.business-status-copy {
    min-width: 0;
}

.business-status-copy strong,
.business-status-copy span {
    display: block;
}

.business-status-copy strong {
    color: var(--auth-text);
    font-size: 12.5px;
    font-weight: 720;
}

.business-status-copy span {
    margin-top: 2px;
    color: var(--auth-text-muted);
    font-size: 11.5px;
}

.business-hours-badge {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 8px;
    color: var(--auth-success);
    background: color-mix(in srgb, var(--auth-success) 10%, transparent);
    font-size: 10px;
    font-weight: 760;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.alert {
    position: relative;
    margin: 0 0 20px;
    padding: 12px 14px 12px 42px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
}

.alert i {
    position: absolute;
    left: 14px;
    top: 14px;
}

.alert-danger {
    color: var(--auth-danger);
    border: 1px solid color-mix(in srgb, var(--auth-danger) 30%, var(--auth-border));
    background: color-mix(in srgb, var(--auth-danger) 8%, transparent);
}

.form-group {
    margin-bottom: 17px;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--auth-text);
    font-size: 12.5px;
    font-weight: 690;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-muted);
    font-size: 14px;
    pointer-events: none;
    transition: color .18s ease;
}

.form-control {
    width: 100%;
    height: 49px;
    padding: 0 46px 0 43px;
    border: 1px solid var(--auth-input-border);
    border-radius: 12px;
    outline: none;
    color: var(--auth-text);
    background: var(--auth-input-bg);
    font-size: 14px;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.form-control::placeholder {
    color: color-mix(in srgb, var(--auth-text-muted) 76%, transparent);
}

.form-control:hover {
    border-color: color-mix(in srgb, var(--auth-primary) 25%, var(--auth-input-border));
}

.form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: var(--auth-focus);
    background: var(--auth-surface-solid);
}

.input-wrap:focus-within .input-icon {
    color: var(--auth-primary);
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--auth-text-muted);
    background: transparent;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease;
}

.password-toggle:hover {
    color: var(--auth-primary);
    background: var(--auth-primary-soft);
}

.login-btn {
    width: 100%;
    min-height: 50px;
    margin-top: 7px;
    border: 0;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, #2457e6, #1f4fd3);
    box-shadow: 0 12px 26px rgba(36, 87, 230, 0.22);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 730;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

html[data-theme="dark"] .login-btn {
    background: linear-gradient(135deg, #597af0, #4265dc);
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 15px 32px rgba(36, 87, 230, 0.29);
    filter: saturate(1.04);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: .78;
    cursor: wait;
}

.login-btn .spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
}

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

.login-btn.is-loading .button-icon {
    display: none;
}

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

.login-footer {
    margin-top: 21px;
    text-align: center;
    color: var(--auth-text-muted);
    font-size: 12.5px;
}

.login-footer p {
    margin: 0;
}

.login-footer a,
.developer-link {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 720;
    border-radius: 4px;
}

.login-footer a:hover,
.developer-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.page-footer {
    text-align: center;
    color: var(--auth-text-muted);
    font-size: 11.5px;
    line-height: 1.6;
}

.page-footer p {
    margin: 0;
}

.page-footer .footer-separator {
    margin: 0 7px;
    opacity: .45;
}

.brand-highlight {
    color: var(--auth-accent);
    font-weight: 720;
}

@media (max-width: 900px) {
    .auth-layout {
        width: min(560px, calc(100% - 32px));
        padding-top: 22px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        padding: 44px 44px 38px;
    }

    .auth-topbar {
        min-height: 42px;
    }
}

@media (max-width: 520px) {
    body.auth-page {
        background: var(--auth-bg);
    }

    .auth-layout {
        width: 100%;
        min-height: 100vh;
        padding: 14px 14px 18px;
        gap: 14px;
    }

    .auth-topbar {
        padding-right: 2px;
    }

    .theme-toggle {
        width: 39px;
        height: 39px;
        border-radius: 11px;
    }

    .auth-shell {
        align-self: stretch;
        border-radius: 22px;
        box-shadow: 0 18px 50px rgba(28, 39, 66, 0.12);
    }

    .auth-form-panel {
        padding: 34px 24px 30px;
        justify-content: flex-start;
    }

    .login-logo-wrap {
        height: 82px;
        margin-bottom: 20px;
    }

    .login-logo {
        width: 154px;
        height: 100px;
    }

    .login-title {
        font-size: 25px;
    }

    .business-hours-indicator {
        align-items: flex-start;
    }

    .business-hours-badge {
        display: none;
    }

    .page-footer .footer-break-mobile {
        display: block;
    }

    .page-footer .footer-separator.footer-break-mobile {
        display: none;
    }
}

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