:root {
    --page-dark: #120f1d;
    --page-dark-2: #1a1428;
    --page-dark-3: #251735;

    --room-text: #fff7ee;
    --room-text-soft: rgba(255, 247, 238, 0.80);
    --room-text-faint: rgba(255, 247, 238, 0.56);

    --gold: #efc56f;
    --shadow-xl: 0 28px 80px rgba(0, 0, 0, 0.34);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.18);
}

* {
    box-sizing: border-box;
}

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

body.chat-auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 16% 14%, rgba(255,255,255,0.06), transparent 16%),
        radial-gradient(circle at 82% 10%, rgba(160, 216, 255, 0.08), transparent 20%),
        radial-gradient(circle at 50% 100%, rgba(239, 197, 111, 0.10), transparent 22%),
        linear-gradient(180deg, var(--page-dark) 0%, var(--page-dark-2) 46%, var(--page-dark-3) 100%);
    color: var(--room-text);
    font-family: "Inter", sans-serif;
    overflow-y: auto;
}

.auth-stage {
    position: relative;
    min-height: 100vh;
    padding: 18px;
    display: flex;
    justify-content: center;
}

.auth-aura {
    position: fixed;
    border-radius: 999px;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
}

.auth-aura-1 {
    width: 320px;
    height: 320px;
    top: -40px;
    left: -20px;
    background: rgba(221, 173, 91, 0.16);
}

.auth-aura-2 {
    width: 420px;
    height: 420px;
    top: 12%;
    right: -80px;
    background: rgba(140, 180, 255, 0.12);
}

.auth-aura-3 {
    width: 360px;
    height: 360px;
    bottom: -80px;
    left: 34%;
    background: rgba(245, 173, 196, 0.10);
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1380px;
    padding: 18px;
    border-radius: 34px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 228, 154, 0.66) 0%, rgba(255, 228, 154, 0.16) 16%, transparent 32%),
        radial-gradient(circle at 0% 50%, rgba(255, 215, 124, 0.42) 0%, rgba(255, 215, 124, 0.08) 16%, transparent 28%),
        radial-gradient(circle at 100% 50%, rgba(154, 224, 255, 0.24) 0%, rgba(154, 224, 255, 0.05) 14%, transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(255, 218, 130, 0.32) 0%, rgba(255, 218, 130, 0.08) 16%, transparent 28%),
        linear-gradient(135deg, #4d3a2f 0%, #b48a3b 28%, #f0d18d 50%, #b68b3d 72%, #4c392e 100%);
    border: 1px solid rgba(255, 231, 179, 0.42);
}

.auth-shell::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 28px;
    border: 1px solid rgba(255, 237, 199, 0.38);
    pointer-events: none;
}

.auth-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(340px, 500px) minmax(0, 1.1fr);
    gap: 20px;
}

.auth-panel {
    order: 1;
}

.auth-hero {
    order: 2;
}

.auth-hero,
.auth-panel {
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(255,255,255,0.04), transparent 16%),
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.03), transparent 16%),
        linear-gradient(180deg, #2a1e39 0%, #20172e 48%, #171120 100%);
    border: 1px solid rgba(255, 229, 168, 0.30);
}

.auth-hero {
    padding: 30px 30px 26px;
}

.auth-panel {
    padding: 24px;
}

.auth-kicker {
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.20em;
    color: var(--gold);
}

.auth-hero h1 {
    margin: 0;
    font-family: "Cormorant Garamond", serif;
    font-size: 34px;
    line-height: 0.95;
    font-weight: 600;
}

.auth-intro {
    margin: 16px 0 0;
    max-width: 760px;
    font-size: 18px;
    line-height: 1.8;
    color: var(--room-text-soft);
}

.auth-soft-points {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.auth-soft-point {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 18px;
}

.auth-soft-point strong {
    font-size: 14px;
}

.auth-soft-point span {
    font-size: 14px;
    line-height: 1.65;
}

.auth-info-card,
.auth-notice,
.auth-result,
.auth-tab,
.ghost-btn,
.form-row input {
    background: rgba(255, 250, 242, 0.06);
    border: 1px solid rgba(255, 236, 200, 0.12);
    color: var(--room-text);
}

.auth-info-card {
    margin-top: 22px;
    padding: 16px 18px;
    border-radius: 20px;
}

.auth-info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
}

.auth-info-row + .auth-info-row {
    border-top: 1px solid rgba(255, 236, 200, 0.08);
}

.auth-info-row span {
    color: var(--room-text-faint);
    font-size: 14px;
}

.auth-info-row strong {
    font-size: 14px;
    text-align: right;
}

.auth-side-actions {
    margin-top: 18px;
}

.ghost-btn,
.primary-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.ghost-btn {
    color: var(--room-text);
}

.primary-btn {
    border: 0;
    color: #442a11;
    background: linear-gradient(180deg, #ffe1a3 0%, #efc56f 100%);
    box-shadow: 0 10px 24px rgba(203, 153, 64, 0.18);
}

.ghost-btn:hover,
.primary-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.primary-btn[disabled],
.ghost-btn[disabled] {
    opacity: 0.62;
    transform: none;
    cursor: not-allowed;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.auth-tab {
    min-height: 46px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.auth-tab.is-active {
    background: rgba(239, 197, 111, 0.14);
    border-color: rgba(239, 197, 111, 0.34);
}

.auth-notice {
    min-height: 58px;
    padding: 14px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 16px;
}

.auth-notice.is-ok {
    background: rgba(136, 216, 169, 0.12);
    border-color: rgba(136, 216, 169, 0.18);
}

.auth-notice.is-err {
    background: rgba(241, 168, 184, 0.12);
    border-color: rgba(241, 168, 184, 0.18);
}

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

.auth-form-panel.is-active {
    display: block;
}

.auth-form-panel h2 {
    margin: 0 0 14px;
    font-family: "Cormorant Garamond", serif;
    font-size: 36px;
    line-height: 1;
    font-weight: 600;
    color: var(--gold);
}

.auth-panel-intro {
    margin: -2px 0 18px;
    font-size: 15px;
    line-height: 1.7;
}

.form-row {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.form-row label {
    font-size: 13px;
    font-weight: 700;
    color: var(--room-text-soft);
}

.form-row input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 15px;
    outline: none;
}

.form-row input::placeholder {
    color: rgba(255, 247, 238, 0.42);
}

.form-row input:focus {
    background: rgba(255, 250, 242, 0.08);
    border-color: rgba(239, 197, 111, 0.34);
    box-shadow: 0 0 0 4px rgba(239, 197, 111, 0.08);
}

.form-actions {
    margin-top: 16px;
}

.auth-inline-links {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.auth-inline-links a {
    color: #7a562d;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.auth-inline-links a:hover,
.auth-inline-links a:focus {
    color: #5d3f1c;
    text-decoration: underline;
}

.auth-result {
    margin: 16px 0 0;
    padding: 12px;
    border-radius: 14px;
    min-height: 96px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.auth-result[hidden] {
    display: none !important;
}

@media (max-width: 1100px) {
    .auth-grid {
        grid-template-columns: 1fr;
    }

    .auth-hero h1 {
        font-size: 50px;
    }
}

@media (max-width: 700px) {
    .auth-stage {
        padding: 10px;
    }

    .auth-shell {
        padding: 12px;
        border-radius: 24px;
    }

    .auth-hero,
    .auth-panel {
        border-radius: 18px;
    }

    .auth-hero {
        padding: 22px 18px 18px;
    }

    .auth-panel {
        padding: 18px;
    }

    .auth-hero h1 {
        font-size: 38px;
    }

    .auth-intro {
        font-size: 16px;
    }

    .auth-soft-point,
    .auth-info-card,
    .auth-notice {
        border-radius: 16px;
    }

    .auth-tabs {
        grid-template-columns: 1fr;
    }

    .auth-form-panel h2 {
        font-size: 30px;
    }
}

/* Warm light overrides for Topmediums */

:root {
    --auth-page: #fcf2de;
    --auth-surface: #fff8ef;
    --auth-surface-2: #fff1dc;
    --auth-border: #e2c49d;
    --auth-border-strong: #d6b186;
    --auth-text: #2f241c;
    --auth-text-soft: #6a5441;
    --auth-text-faint: #7a614b;
    --auth-accent: #d9a441;
    --auth-primary: #2e9e5b;
    --auth-primary-dark: #25874d;
}

body.chat-auth-page {
    background: var(--auth-page);
    color: var(--auth-text);
    font-family: "Open Sans", sans-serif;
}

.auth-aura {
    display: none;
}

.auth-shell {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.auth-shell::before {
    display: none;
}

.auth-hero,
.auth-panel,
.auth-info-card,
.auth-soft-point,
.auth-notice,
.auth-tab,
.ghost-btn,
.form-row input {
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    color: var(--auth-text);
    box-shadow: 0 10px 22px rgba(110, 79, 40, 0.10);
}

.auth-hero,
.auth-panel {
    border-radius: 24px;
}

.auth-kicker {
    color: var(--auth-accent);
}

.auth-hero h1,
.auth-form-panel h2 {
    font-family: "Adamina", Georgia, serif;
    color: var(--auth-text);
}

.auth-intro,
.auth-info-row span,
.form-row label,
.auth-panel-intro,
.auth-soft-point span {
    color: var(--auth-text-soft);
}

.auth-soft-point strong {
    color: var(--auth-text);
}

.auth-grid {
    align-items: start;
    gap: 22px;
}

.auth-hero {
    padding: 34px 34px 30px;
}

.auth-panel {
    padding: 28px;
}

.auth-info-card {
    margin-top: 18px;
}

.auth-notice {
    position: relative;
    padding: 16px 18px;
    line-height: 1.7;
}

.auth-notice::before {
    content: "";
    display: block;
    width: 42px;
    height: 3px;
    margin-bottom: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f3c985, #d9a441);
}

.auth-tab {
    font-weight: 600;
}

.form-row {
    gap: 7px;
    margin-bottom: 14px;
}

.form-actions {
    margin-top: 18px;
}

.auth-check-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin-top: 4px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--auth-surface-2);
    border: 1px solid var(--auth-border);
    color: var(--auth-text-soft);
    font-size: 14px;
    line-height: 1.65;
}

.auth-check-row input {
    margin-top: 3px;
}

.auth-check-row a {
    color: #7a562d;
    font-weight: 700;
    text-decoration: none;
}

.auth-check-row a:hover,
.auth-check-row a:focus {
    color: #5d3f1c;
    text-decoration: underline;
}

.auth-inline-links {
    margin-top: 16px;
}

.auth-info-row + .auth-info-row {
    border-top: 1px solid #ecd8bf;
}

.ghost-btn,
.primary-btn,
.auth-tab {
    min-height: 42px;
    border-radius: 10px;
    box-shadow: none;
}

.ghost-btn {
    background: #fff8ef;
    border: 1px solid #d6b186;
    color: #5a4331;
}

.primary-btn {
    background: var(--auth-primary);
    border: 1px solid var(--auth-primary);
    color: #fff;
}

.auth-tab.is-active {
    background: var(--auth-surface-2);
    border-color: var(--auth-border-strong);
}

.ghost-btn:hover,
.primary-btn:hover,
.auth-tab:hover {
    transform: none;
}

.ghost-btn:hover {
    background: #fff0dc;
    border-color: #c79b6a;
    color: #422f22;
}

.account-consultants-btn {
    background: linear-gradient(180deg, #ecd28f 0%, #d9a441 100%) !important;
    border-color: #2e9e5b !important;
    color: #fff7ef !important;
}

.account-consultants-btn:hover,
.account-consultants-btn:focus {
    background: linear-gradient(180deg, #37a96a 0%, #25874d 100%) !important;
    border-color: #25874d !important;
    color: #fffaf3 !important;
}

.primary-btn:hover {
    background: var(--auth-primary-dark);
    border-color: var(--auth-primary-dark);
}

.auth-notice {
    color: #5d4735;
}

.auth-notice.is-ok {
    background: #f7f2e7;
    border-color: #d7c4a4;
    color: #4f3f31;
}

.auth-notice.is-err {
    background: #fff0ea;
    border-color: #e1b39f;
    color: #7a3f2a;
}

.form-row input {
    background: #fffdf9;
}

.form-row input::placeholder {
    color: #9b856e;
}

.form-row input:focus {
    background: #fffdf9;
    border-color: #d6b186;
    box-shadow: 0 0 0 4px rgba(214, 177, 134, 0.18);
}

.auth-result {
    display: none;
}
h1,
h2,
h3 {
    font-family: 'Adamina', Georgia, serif !important;
    font-weight: 400 !important;
}

@media (max-width: 700px) {
    .auth-stage {
        min-height: auto;
        padding: 8px 10px 14px;
    }

    .auth-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .auth-panel {
        order: 1;
        padding: 14px;
        border-radius: 18px;
        scroll-margin-top: 10px;
    }

    .auth-hero {
        order: 2;
        padding: 16px;
        border-radius: 18px;
    }

    .auth-kicker {
        margin-bottom: 6px;
        font-size: 10px;
        letter-spacing: 0.14em;
    }

    .auth-hero h1 {
        font-size: 24px;
        line-height: 1.15;
    }

    .auth-intro {
        margin-top: 8px;
        font-size: 14px;
        line-height: 1.55;
    }

    .auth-soft-points,
    .auth-side-actions {
        display: none;
    }

    .auth-tabs {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 10px;
    }

    .auth-tab {
        min-height: 40px;
        font-size: 13px;
    }

    .auth-notice {
        min-height: 0;
        padding: 10px 12px;
        margin-bottom: 12px;
        border-radius: 12px;
        font-size: 13px;
        line-height: 1.45;
    }

    .auth-notice::before {
        display: none;
    }

    .auth-form-panel h2 {
        margin-bottom: 8px;
        font-size: 24px;
    }

    .auth-panel-intro {
        margin: 0 0 12px;
        font-size: 13px;
        line-height: 1.45;
    }

    .form-row {
        gap: 5px;
        margin-bottom: 10px;
    }

    .form-row input {
        height: 42px;
        border-radius: 10px;
        font-size: 15px;
    }

    .form-actions {
        margin-top: 12px;
    }

    .primary-btn {
        width: 100%;
        min-height: 42px;
    }
}

/* Topmediums calm light refinement */
:root {
    --tm-page-soft: #fff8ef;
    --tm-surface: #fffaf5;
    --tm-surface-soft: #fff1e6;
    --tm-ink: #251a31;
    --tm-muted: #6f6078;
    --tm-line: #f0cdb8;
    --tm-gold: #e6ac55;
    --tm-green: #318760;
    --tm-green-dark: #28704f;
}

body.chat-auth-page {
    background: linear-gradient(180deg, #fff6ee 0%, #ffefe1 100%);
    color: var(--tm-ink);
}

.auth-stage {
    min-height: auto;
    padding: 24px 18px 46px;
}

.auth-shell {
    max-width: 1080px;
}

.auth-grid {
    grid-template-columns: minmax(0, 0.92fr) minmax(360px, 460px);
    gap: 28px;
}

.auth-hero,
.auth-panel,
.auth-info-card,
.auth-soft-point,
.auth-notice,
.auth-tab,
.form-row input,
.auth-check-row {
    border-radius: 8px;
    box-shadow: none;
}

.auth-hero,
.auth-panel {
    background: transparent;
    border: 0;
}

.auth-panel {
    background: var(--tm-surface);
    border: 1px solid rgba(240, 205, 184, 0.82);
    padding: 26px;
}

.auth-hero {
    padding: 26px 0 20px;
}

.auth-kicker {
    color: #6f4e80;
    letter-spacing: 0.08em;
}

.auth-hero h1,
.auth-form-panel h2 {
    color: var(--tm-ink);
    line-height: 1.15;
}

.auth-hero h1 {
    max-width: 680px;
    font-size: 32px;
}

.auth-intro {
    max-width: 700px;
    color: var(--tm-muted);
    font-size: 16px;
    line-height: 1.7;
}

.auth-soft-points {
    gap: 10px;
    margin-top: 20px;
}

.auth-soft-point {
    background: transparent;
    border: 0;
    border-left: 3px solid rgba(230, 172, 85, 0.72);
    padding: 8px 0 8px 14px;
}

.auth-notice {
    background: var(--tm-surface-soft);
    border-color: rgba(240, 205, 184, 0.9);
    color: var(--tm-muted);
}

.auth-notice::before {
    background: var(--tm-gold);
}

.auth-info-card,
.auth-check-row {
    background: var(--tm-surface-soft);
    border-color: rgba(240, 205, 184, 0.9);
}

.auth-tab {
    background: transparent;
    border-color: rgba(37, 26, 49, 0.18);
    color: var(--tm-ink);
}

.auth-tab.is-active {
    background: #251a31;
    border-color: #251a31;
    color: #fffaf5;
}

.form-row input {
    background: #fffefc;
    border-color: rgba(37, 26, 49, 0.16);
    color: var(--tm-ink);
}

.form-row input:focus {
    border-color: rgba(49, 135, 96, 0.48);
    box-shadow: 0 0 0 3px rgba(49, 135, 96, 0.10);
}

.primary-btn {
    background: var(--tm-green);
    border-color: var(--tm-green);
    color: #fff;
}

.primary-btn:hover,
.primary-btn:focus {
    background: var(--tm-green-dark);
    border-color: var(--tm-green-dark);
}

.ghost-btn,
.account-consultants-btn {
    background: transparent !important;
    border-color: rgba(37, 26, 49, 0.22) !important;
    color: var(--tm-ink) !important;
}

.ghost-btn:hover,
.ghost-btn:focus,
.account-consultants-btn:hover,
.account-consultants-btn:focus {
    background: rgba(255, 241, 230, 0.86) !important;
    border-color: rgba(230, 172, 85, 0.72) !important;
    color: var(--tm-ink) !important;
}

@media (max-width: 700px) {
    .auth-stage {
        padding: 14px 12px 28px;
    }

    .auth-grid {
        gap: 12px;
    }

    .auth-panel,
    .auth-hero {
        padding: 16px 0;
    }

    .auth-panel {
        padding: 16px;
    }

    .auth-hero h1 {
        font-size: 25px;
    }
}
