.xx-auth-page {
    --auth-red: #c91f37;
    --auth-red-deep: #8e1427;
    --auth-ink: #20242c;
    --auth-muted: #69707d;
    --auth-cream: #fff8f2;
    --auth-gold: #f6bd4b;
    min-height: min(720px, calc(100vh - 210px));
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(420px, 1.08fr);
    overflow: hidden;
    margin: 1.25rem 0 0;
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(71, 19, 29, .13);
}

.xx-auth-story {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 640px;
    padding: clamp(2rem, 4vw, 4rem);
    overflow: hidden;
    color: #fff;
    background: var(--auth-red-deep);
}

.xx-auth-story::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: var(--auth-photo) var(--auth-photo-position, center) / cover no-repeat;
    transform: scale(1.015);
}

.xx-auth-story::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(40, 10, 17, .26), rgba(114, 10, 30, .94));
}

.xx-auth-brand {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    width: fit-content;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: .02em;
}

.xx-auth-brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .16));
}

.xx-auth-story-copy { width: 100%; max-width: 560px; }
.xx-auth-story-copy small {
    display: block;
    margin-bottom: 1rem;
    color: var(--auth-gold);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.xx-auth-story-copy h1 {
    margin: 0 0 1rem;
    font-family: "STKaiti", "KaiTi", "Songti SC", serif;
    font-size: clamp(3rem, 3.6vw, 4.15rem);
    font-weight: 800;
    line-height: .98;
    letter-spacing: -.05em;
}
.xx-auth-story-copy h1 span { display: block; white-space: nowrap; }
.xx-auth-story-copy p { margin: 0; color: rgba(255,255,255,.82); line-height: 1.8; }

.xx-auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 6vw, 5rem);
    background:
        radial-gradient(circle at 92% 9%, rgba(201,31,55,.09) 0 96px, transparent 97px),
        #fff;
}

.xx-auth-card { width: min(100%, 500px); }
.xx-auth-eyebrow { margin: 0 0 .55rem; color: var(--auth-red); font-size: .78rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.xx-auth-card h2 { margin: 0; color: var(--auth-ink); font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 900; letter-spacing: -.055em; }
.xx-auth-lead { margin: .8rem 0 2rem; color: var(--auth-muted); line-height: 1.7; }

.xx-auth-field { margin-bottom: 1.2rem; }
.xx-auth-field label { display: block; margin-bottom: .52rem; color: #333943; font-size: .9rem; font-weight: 800; }
.xx-auth-control {
    width: 100%;
    min-height: 52px;
    padding: .78rem 1rem;
    border: 1px solid #dfe2e7;
    border-radius: 14px;
    color: var(--auth-ink);
    background: #fff;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.xx-auth-control::placeholder { color: #a0a5ae; }
.xx-auth-control:hover { border-color: #c7cbd1; }
.xx-auth-control:focus { border-color: var(--auth-red); box-shadow: 0 0 0 4px rgba(201,31,55,.11); }

.xx-auth-password { position: relative; }
.xx-auth-password .xx-auth-control { padding-right: 3.25rem; }
.xx-password-toggle {
    position: absolute;
    top: 50%;
    right: .7rem;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    color: #727985;
    background: transparent;
}
.xx-password-toggle:hover { color: var(--auth-red); background: #fff0f2; }

.xx-captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: .75rem; }
.xx-captcha-image {
    width: 120px;
    height: 52px;
    border: 1px solid #e2e4e8;
    border-radius: 14px;
    object-fit: contain;
    cursor: pointer;
    background: #fff;
}
.xx-captcha-tip { margin-top: .38rem; color: #8b919b; font-size: .78rem; }

.xx-auth-submit {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: var(--auth-red);
    box-shadow: 0 12px 25px rgba(201,31,55,.22);
    font-weight: 900;
    letter-spacing: .03em;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.xx-auth-submit:hover { transform: translateY(-2px); background: #aa172e; box-shadow: 0 16px 32px rgba(201,31,55,.27); }
.xx-auth-submit:disabled { transform: none; opacity: .65; cursor: wait; }
.xx-auth-secondary { margin-top: 1.2rem; text-align: center; color: var(--auth-muted); font-size: .9rem; }
.xx-auth-secondary a { color: var(--auth-red); font-weight: 800; text-decoration: none; }

.xx-reset-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1.6rem 0 2rem; }
.xx-reset-step { position: relative; padding-top: 1.9rem; color: #9aa0a8; font-size: .76rem; font-weight: 800; }
.xx-reset-step::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 9px; background: #eceef1; }
.xx-reset-step.is-active { color: var(--auth-red); }
.xx-reset-step.is-active::before { background: var(--auth-red); }
.xx-reset-step.is-done::before { background: var(--auth-gold); }

.xx-reset-panel[hidden] { display: none !important; }
.xx-reset-help { padding: .85rem 1rem; border-left: 3px solid var(--auth-gold); color: #666d78; background: var(--auth-cream); font-size: .86rem; line-height: 1.65; }
.xx-password-rules { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .7rem; margin: .8rem 0 1.2rem; padding: 0; list-style: none; color: #858b95; font-size: .8rem; }
.xx-password-rules li::before { content: "○"; margin-right: .35rem; }
.xx-password-rules li.is-ok { color: #16845b; }
.xx-password-rules li.is-ok::before { content: "●"; }
.xx-reset-resend { margin-top: .7rem; color: #818893; font-size: .83rem; text-align: center; }

@media (max-width: 991.98px) {
    .xx-auth-page { grid-template-columns: 1fr; margin-top: .5rem; }
    .xx-auth-story { min-height: 230px; padding: 1.6rem; }
    .xx-auth-story-copy h1 { font-size: 2.65rem; }
    .xx-auth-story-copy p { display: none; }
    .xx-auth-main { padding: 2.4rem 1.5rem; }
}

@media (max-width: 575.98px) {
    .xx-auth-page { margin-inline: -.25rem; border-radius: 20px; }
    .xx-auth-story { min-height: 190px; }
    .xx-auth-story-copy small { margin-bottom: .55rem; }
    .xx-auth-story-copy h1 { font-size: 2.25rem; }
    .xx-auth-main { padding: 2rem 1.2rem 2.4rem; }
    .xx-auth-card h2 { font-size: 2.2rem; }
    .xx-auth-lead { margin-bottom: 1.5rem; }
    .xx-password-rules { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .xx-auth-submit, .xx-auth-control { transition: none; }
}
