body {
    overflow-x: hidden;
    overflow-y: auto;
}

input, button {
    font: inherit;
}

input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.auth-page {
    min-height: 100svh;
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
}

.auth-page::before {
    content: "";
    position: absolute;
    z-index: -3;
    inset: 0;
    background: radial-gradient(circle at 18% 24%, rgba(244, 163, 34, .13), transparent 27%), radial-gradient(circle at 82% 72%, rgba(47, 79, 112, .18), transparent 30%), linear-gradient(135deg, #05070a 0%, #090c11 48%, #05070a 100%);
}

.auth-page::after {
    content: "";
    position: absolute;
    z-index: -2;
    inset: 0;
    opacity: .25;
    background-image: radial-gradient(circle, rgba(255,255,255,.52) 0 1px, transparent 1.2px), radial-gradient(circle, rgba(255,255,255,.28) 0 1px, transparent 1.2px);
    background-position: 0 0, 34px 42px;
    background-size: 96px 96px, 134px 134px;
    mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.auth-glow {
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 50%;
    width: min(720px, 85vw);
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    border: 1px solid rgba(244,163,34,.07);
    box-shadow: 0 0 0 90px rgba(244,163,34,.018), 0 0 0 180px rgba(244,163,34,.012), inset 0 0 120px rgba(244,163,34,.025);
    pointer-events: none;
}

.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px clamp(18px, 3vw, 42px);
}

.auth-main {
    width: 100%;
    display: grid;
    place-items: center;
    padding: 24px 18px 42px;
}

.auth-shell {
    width: min(100%, 980px);
    min-height: 610px;
    display: grid;
    grid-template-columns: minmax(280px, .88fr) minmax(360px, 1.12fr);
    border: 1px solid var(--line);
    border-radius: 30px;
    overflow: hidden;
    background: rgba(10, 13, 18, .76);
    backdrop-filter: blur(28px);
    box-shadow: 0 34px 110px rgba(0,0,0,.48);
}

html[data-theme="day"] .auth-shell {
    background: rgba(251,249,245,.84);
}

.auth-intro {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(30px, 5vw, 58px);
    border-right: 1px solid var(--line);
    overflow: hidden;
}

.auth-intro::before {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -190px;
    bottom: -170px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244,163,34,.25), rgba(244,163,34,.025) 52%, transparent 70%);
}

.intro-copy {
    position: relative;
    z-index: 1;
}

.intro-copy .eyebrow {
    margin-bottom: 18px;
}

.intro-copy h1 {
    margin: 0;
    max-width: 430px;
    font-size: clamp(2.15rem, 4.3vw, 4rem);
    line-height: .98;
    letter-spacing: -.055em;
}

.intro-copy p {
    margin: 22px 0 0;
    max-width: 360px;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.7;
}

.secure-note {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: .75rem;
}

.secure-note span:first-child {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--accent-text);
    border: 1px solid rgba(244,163,34,.24);
    background: var(--accent-soft);
}

.secure-note svg {
    width: 16px;
    height: 16px;
}

.auth-stage {
    position: relative;
    display: grid;
    align-items: center;
    padding: clamp(28px, 5vw, 58px);
}

.auth-view {
    display: none;
    animation: viewIn .32s ease both;
}

.auth-view.is-active {
    display: block;
}

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

.view-header {
    margin-bottom: 28px;
}

.view-header h2 {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2.2rem);
    letter-spacing: -.035em;
}

.view-header p {
    margin: 9px 0 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: .88rem;
}

.field-grid {
    display: grid;
    gap: 16px;
}

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

.field {
    display: grid;
    gap: 8px;
}

.field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.field label {
    color: var(--text);
    font-size: .77rem;
    font-weight: 650;
}

.field-link, .switch-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-text);
    cursor: pointer;
    font-size: .75rem;
    text-decoration: none;
}

.field-link:hover, .switch-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    width: 100%;
    height: 50px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255,255,255,.035);
    color: var(--text);
    padding: 0 46px 0 15px;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

html[data-theme="day"] .input-wrap input {
    background: rgba(255,255,255,.56);
}

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

.input-wrap input:focus {
    border-color: rgba(244,163,34,.62);
    box-shadow: 0 0 0 4px rgba(244,163,34,.09);
}

.input-wrap input::placeholder {
    color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    translate: 0 -50%;
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: .76rem;
}

.check-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-text);
}

.primary-action, .secondary-action {
    width: 100%;
    min-height: 50px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 750;
    letter-spacing: .01em;
    transition: transform .18s ease, filter .18s ease, border-color .18s ease;
}

.primary-action {
    border: 0;
    background: var(--accent);
    color: #191108;
    box-shadow: 0 13px 32px rgba(244,163,34,.18);
}

.secondary-action {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
}

.primary-action:hover, .secondary-action:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.primary-action:active, .secondary-action:active {
    transform: translateY(0);
}

.form-foot {
    margin: 20px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: .78rem;
}

.form-note {
    margin: 15px 0 0;
    color: var(--muted);
    font-size: .7rem;
    line-height: 1.55;
    text-align: center;
}

.logout-orb {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    border-radius: 50%;
    color: var(--accent-text);
    background: radial-gradient(circle at 35% 30%, rgba(244,163,34,.28), rgba(244,163,34,.07));
    border: 1px solid rgba(244,163,34,.22);
    box-shadow: 0 0 42px rgba(244,163,34,.12);
}

.logout-orb svg {
    width: 34px;
    height: 34px;
}

.button-stack {
    display: grid;
    gap: 10px;
    margin-top: 25px;
}

.demo-message {
    display: none;
    margin: 15px 0 0;
    padding: 11px 13px;
    border: 1px solid rgba(99,217,139,.24);
    border-radius: 13px;
    background: rgba(99,217,139,.08);
    color: #76dc98;
    font-size: .76rem;
    line-height: 1.45;
}

.demo-message.is-visible {
    display: block;
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 18px;
    color: rgba(241,244,247,.52);
    font-size: .68rem;
}

.auth-footer a {
    color: inherit;
    text-decoration: none;
}

.auth-footer a:hover {
    color: #f1f4f7;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 760px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: auto;
        max-width: 540px;
    }
    .auth-intro {
        min-height: 230px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .intro-copy h1 {
        font-size: clamp(2rem, 10vw, 3.2rem);
        max-width: 420px;
    }
    .intro-copy p {
        margin-top: 14px;
    }
    .secure-note {
        margin-top: 34px;
    }
    .auth-stage {
        min-height: 500px;
    }
}

@media (max-width: 480px) {
    .auth-header {
        padding: 15px;
    }
    .auth-main {
        padding: 12px 10px 28px;
        align-items: start;
    }
    .auth-shell {
        border-radius: 23px;
    }
    .auth-intro, .auth-stage {
        padding: 27px 23px;
    }
    .auth-intro {
        min-height: 215px;
    }
    .auth-stage {
        min-height: 490px;
    }
    .field-row {
        grid-template-columns: 1fr;
    }
    .view-header {
        margin-bottom: 22px;
    }
}
