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

:root {
    --auth-orange: #ff9a24;
    --auth-ink: #0c0c0c;
    --auth-muted: #858585;
    --auth-border: #e3e3e3;
}

* { box-sizing: border-box; }

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

body.auth-page {
    margin: 0;
    background: #fff;
    color: var(--auth-ink);
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-shell { display: flex; min-height: 100vh; width: 100%; }

.auth-visual {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: #fff;
    background: #171717 url('/include/v4/images/sign-in-bg.jpg') center / cover no-repeat;
}

.auth-visual-bg {
    position: absolute;
    z-index: 0;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0;
    transform: scale(1.01);
    transition: opacity 1.15s ease;
    will-change: opacity;
}

.auth-visual-bg--original { background-image: url('/include/v4/images/sign-in-bg.jpg'); }
.auth-visual-bg--twilight { background-image: url('/include/v5/images/auth-login-twilight.jpg'); }
.auth-visual-bg.is-active { opacity: 1; }

.auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,.76) 0%, rgba(0,0,0,.36) 60%, rgba(0,0,0,.56) 100%);
    z-index: 1;
    pointer-events: none;
}

.auth-visual::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 42%;
    background: linear-gradient(0deg, rgba(0,0,0,.67), transparent);
    z-index: 1;
    pointer-events: none;
}

.auth-visual-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    padding: 40px 48px 34px;
}

@media (prefers-reduced-motion: reduce) {
    .auth-visual-bg { transition: none; }
}

.auth-logo { display: inline-flex; width: fit-content; }
.auth-logo img { display: block; width: 174px; height: auto; }

.auth-story {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    max-width: 450px;
}

.auth-eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 22px;
    color: var(--auth-orange);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.auth-eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.auth-story h2 {
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(42px, 4vw, 56px);
    font-weight: 800;
    letter-spacing: -1.8px;
    line-height: 1.04;
}

.auth-story p {
    max-width: 360px;
    margin: 0;
    color: rgba(255,255,255,.58);
    font-size: 15px;
    line-height: 1.72;
}

.auth-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    padding-top: 26px;
    border-top: 1px solid rgba(255,255,255,.16);
}

.auth-stat strong { display: block; margin-bottom: 6px; color: #fff; font-size: 21px; line-height: 1; }
.auth-stat span { color: rgba(255,255,255,.43); font-size: 11px; font-weight: 600; }

.auth-help { padding-top: 26px; border-top: 1px solid rgba(255,255,255,.16); }
.auth-help small { display: block; margin-bottom: 11px; color: rgba(255,255,255,.35); font-size: 12px; }
.auth-help-links { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.auth-help a { color: rgba(255,255,255,.7); font-size: 13px; font-weight: 700; text-decoration: none; }
.auth-help a:hover { color: #fff; }

.auth-panel {
    display: flex;
    flex: 0 0 480px;
    flex-direction: column;
    width: 480px;
    min-height: 100vh;
    background: #fff;
}

.auth-mobile-header { display: none; }

.auth-panel-main {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    padding: 48px 54px;
}

.auth-form-wrap { width: 100%; max-width: 360px; }

.auth-heading { margin-bottom: 27px; }
.auth-heading h1 { margin: 0 0 10px; font-size: 32px; font-weight: 800; letter-spacing: -.9px; line-height: 1.08; }
.auth-heading p { margin: 0; color: var(--auth-muted); font-size: 14px; line-height: 1.6; }
.auth-heading a, .auth-text-link { color: var(--auth-orange); font-weight: 700; text-decoration: none; }
.auth-heading a:hover, .auth-text-link:hover { text-decoration: underline; }

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: -8px 0 20px;
    padding: 12px 14px;
    border: 1px solid #ffc7c2;
    border-radius: 11px;
    color: #b42318;
    background: #fff4f3;
    font-size: 12px;
    line-height: 1.5;
}

.auth-form { display: flex; flex-direction: column; gap: 17px; }
.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-field label { color: var(--auth-ink); font-size: 11px; font-weight: 800; letter-spacing: .55px; text-transform: uppercase; }
.auth-label-row a { color: var(--auth-orange); font-size: 12px; font-weight: 700; text-decoration: none; }
.auth-label-row a:hover { text-decoration: underline; }

.auth-input-shell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.auth-input-shell:focus-within { border-color: var(--auth-orange); box-shadow: 0 0 0 3px rgba(255,154,36,.1); }
.auth-input-shell.is-error { border-color: #ef4444; }
.auth-input-shell svg { width: 16px; height: 16px; color: #aaa; flex: 0 0 auto; }
.auth-input-shell input {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--auth-ink);
    background: transparent;
    font: inherit;
    font-size: 14px;
}
.auth-input-shell input::placeholder { color: #c7c7c7; }

.auth-password-toggle {
    display: grid;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    place-items: center;
    color: #aaa;
    background: none;
    cursor: pointer;
}
.auth-password-toggle:hover { color: #555; }

.auth-remember { display: flex; align-items: center; gap: 10px; width: fit-content; cursor: pointer; }
.auth-remember input { position: absolute; opacity: 0; pointer-events: none; }
.auth-check {
    display: grid;
    width: 18px;
    height: 18px;
    border: 2px solid #d4d4d4;
    border-radius: 5px;
    place-items: center;
    background: #fff;
}
.auth-check::after { content: '✓'; color: #fff; font-size: 11px; font-weight: 800; opacity: 0; }
.auth-remember input:checked + .auth-check { border-color: var(--auth-orange); background: var(--auth-orange); }
.auth-remember input:checked + .auth-check::after { opacity: 1; }
.auth-remember span:last-child { color: #666; font-size: 13px; font-weight: 600; }

.auth-submit, .auth-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 49px;
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.auth-submit { border: 0; color: #fff; background: var(--auth-orange); box-shadow: 0 5px 20px rgba(255,154,36,.32); }
.auth-submit:not(:disabled):hover { transform: translateY(-1px); background: #f88b0c; }
.auth-submit:disabled { color: #fff; background: #d4d4d4; box-shadow: none; cursor: not-allowed; }
.auth-secondary { border: 1px solid var(--auth-border); color: var(--auth-ink); background: #fff; text-decoration: none; }
.auth-secondary:hover { border-color: var(--auth-ink); }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 25px 0; color: #c4c4c4; font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #eee; }

.auth-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 30px;
    border-top: 1px solid #f0f0f0;
}
.auth-legal nav { display: flex; gap: 17px; }
.auth-legal a { color: #aaa; font-size: 11px; font-weight: 600; text-decoration: none; }
.auth-legal a:hover { color: var(--auth-orange); }
.auth-legal span { color: #c6c6c6; font-size: 11px; }

.auth-success { display: none; animation: authEnter .35s ease both; }
.auth-success.is-visible { display: block; }
.auth-success-icon { display: grid; width: 56px; height: 56px; margin-bottom: 23px; border: 1px solid #bbf7d0; border-radius: 50%; place-items: center; color: #16a34a; background: #f0fdf4; }
.auth-success-icon svg { width: 27px; height: 27px; }
.auth-success h1 { margin: 0 0 10px; font-size: 30px; font-weight: 800; letter-spacing: -.7px; }
.auth-success > p { margin: 0 0 24px; color: #777; font-size: 14px; line-height: 1.65; }
.auth-success strong { color: var(--auth-ink); }
.auth-tips { display: grid; gap: 12px; margin-bottom: 23px; padding: 18px; border-radius: 14px; background: #f8f8f8; }
.auth-tip { display: flex; align-items: flex-start; gap: 10px; color: #666; font-size: 12px; line-height: 1.5; }
.auth-tip::before { content: '✓'; display: grid; width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid #ffd5a0; border-radius: 50%; place-items: center; color: var(--auth-orange); background: #fff6ec; font-size: 9px; font-weight: 800; }
.auth-success-actions { display: grid; gap: 11px; }
.auth-link-button { padding: 8px; border: 0; color: #999; background: none; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.auth-link-button:hover { color: #444; }
.auth-inline-error { display: none; margin: 0; color: #c0362c; font-size: 12px; line-height: 1.5; }
.auth-inline-error.is-visible { display: block; }

@keyframes authEnter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1023px) {
    .auth-visual { display: none; }
    .auth-panel { flex: 1 1 auto; width: 100%; }
    .auth-mobile-header { display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: 14px 24px; border-bottom: 1px solid #eee; }
    .auth-mobile-logo img { display: block; width: 132px; height: auto; }
    .auth-mobile-header a { color: var(--auth-orange); font-size: 13px; font-weight: 800; text-decoration: none; }
}

@media (max-width: 540px) {
    .auth-panel-main { align-items: flex-start; padding: 45px 24px; }
    .auth-heading h1 { font-size: 30px; }
    .auth-legal { padding: 17px 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
