.page-auth .page-main {
    padding-top: 32px;
}

.auth-page {
    padding: 48px 0 24px;
}

.auth-container {
    width: min(680px, calc(100% - 40px));
}

.auth-shell {
    display: block;
    max-width: 500px;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

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

.auth-shell--compact {
    grid-template-columns: minmax(0, 1fr);
}

.auth-visual {
    display: none;
}

.auth-visual-art {
    display: flex;
    align-items: flex-end;
    min-height: 220px;
}

.auth-visual-orb {
    position: absolute;
    inset: auto 10% 0 auto;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(196, 163, 90, 0.32), transparent 68%);
    filter: blur(14px);
}

.auth-visual-card {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
    max-width: 280px;
    padding: 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
    animation: authFloat 7.6s ease-in-out infinite;
}

.auth-visual-card span {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-visual-card strong {
    font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.08;
}

.auth-panel {
    position: relative;
    display: grid;
    align-content: start;
    gap: 18px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 28px 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    background:
        radial-gradient(circle at top center, rgba(255, 255, 255, 0.03), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
        #171a1f;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 18px 48px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

body[data-theme="1"] .auth-panel {
    border-color: rgba(47, 122, 97, 0.12);
    background:
        radial-gradient(circle at top center, rgba(255, 255, 255, 0.78), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 241, 233, 0.94));
    box-shadow: 0 24px 56px rgba(35, 63, 49, 0.12);
}

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

.auth-panel > * {
    position: relative;
    z-index: 1;
}

.auth-panel h1 {
    margin: 0;
    font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
    font-size: clamp(1.85rem, 4vw, 2.7rem);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.05em;
    text-align: center;
}

body[data-theme="1"] .auth-panel h1 {
    color: var(--text-primary);
}

.auth-panel-text {
    max-width: 25rem;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.96rem;
    line-height: 1.65;
    text-align: center;
    justify-self: center;
}

.auth-panel-text--small {
    font-size: 0.94rem;
}

.auth-support-panel {
    display: grid;
    gap: 10px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        var(--surface-elevated);
    box-shadow: none;
}

body[data-theme="1"] .auth-support-panel {
    border-color: rgba(47, 122, 97, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(241, 238, 232, 0.92)),
        var(--surface-elevated);
}

.auth-support-panel--password {
    gap: 12px;
    border-color: rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
        rgba(255, 255, 255, 0.02);
}

body[data-theme="1"] .auth-support-panel--password {
    border-color: rgba(47, 122, 97, 0.1);
    background:
        linear-gradient(180deg, rgba(244, 250, 246, 0.9), rgba(252, 250, 246, 0.94)),
        rgba(255, 255, 255, 0.82);
}

.auth-support-panel--password .auth-support-label {
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

body[data-theme="2"] .auth-support-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
        var(--surface-elevated);
}

.page-auth .section-kicker {
    justify-self: center;
    min-width: 0;
    justify-content: center;
    padding-inline: 16px;
    background: rgba(43, 122, 91, 0.18);
    color: #59de8c;
}

body[data-theme="1"] .page-auth .section-kicker {
    background: rgba(47, 122, 97, 0.12);
    color: var(--color-primary-dark);
}

.auth-support-label {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-support-email {
    font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-support-note {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.65;
}

.auth-support-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-secondary);
}

.auth-support-panel--password .auth-support-list {
    gap: 10px;
    padding-left: 1rem;
}

.auth-support-list li::marker {
    color: var(--color-primary);
}

.auth-consent-panel {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid rgba(89, 222, 140, 0.14);
    border-radius: 20px;
    background:
        radial-gradient(circle at left top, rgba(89, 222, 140, 0.09), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
        rgba(255, 255, 255, 0.02);
}

body[data-theme="1"] .auth-consent-panel {
    border-color: rgba(47, 122, 97, 0.12);
    background:
        radial-gradient(circle at left top, rgba(47, 122, 97, 0.08), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(241, 238, 232, 0.94));
}

.auth-consent-toggle {
    align-items: center;
}

.auth-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-legal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 700;
}

.auth-legal-link:hover,
.auth-legal-link:focus-visible {
    border-color: rgba(43, 122, 91, 0.3);
    color: var(--color-primary);
    transform: translateY(-1px);
    outline: none;
}

.auth-form,
.auth-inline-form {
    display: grid;
    gap: 14px;
}

.field {
    position: relative;
    display: block;
}


.field input {
    width: 100%;
    min-height: 58px;
    padding: 22px 54px 10px 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
        #1a1f22;
    color: var(--input-text);
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-theme="1"] .field input {
    border-color: rgba(47, 122, 97, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 241, 235, 0.96)),
        var(--input-bg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

body[data-theme="2"] .field input {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
        var(--input-bg);
}

.field input:hover {
    border-color: rgba(255, 255, 255, 0.16);
}

body[data-theme="1"] .field input:hover {
    border-color: rgba(47, 122, 97, 0.22);
}

.field input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(43, 122, 91, 0.12);
}

body[data-theme="2"] .field input:focus {
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.12);
}

.field-icon {
    position: absolute;
    top: 50%;
    left: 18px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
    transition: color 0.2s ease;
}

.field-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.field-label {
    position: absolute;
    top: 50%;
    left: 46px;
    color: var(--text-muted);
    font-weight: 700;
    transform: translateY(-50%);
    pointer-events: none;
    transition:
        top 0.2s ease,
        transform 0.2s ease,
        color 0.2s ease,
        font-size 0.2s ease;
}

.field input:focus ~ .field-label,
.field input:not(:placeholder-shown) ~ .field-label {
    top: 13px;
    transform: translateY(0);
    color: var(--color-primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.field input:focus ~ .field-icon,
.field input:not(:placeholder-shown) ~ .field-icon {
    color: var(--color-primary);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--text-muted);
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--color-primary);
    background: rgba(43, 122, 91, 0.08);
}

.password-toggle-icon--hide {
    display: none;
}

.password-toggle[aria-pressed="true"] .password-toggle-icon--show {
    display: none;
}

.password-toggle[aria-pressed="true"] .password-toggle-icon--hide {
    display: inline;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    justify-content: center;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 8px;
}

body[data-theme="1"] .auth-links {
    border-top-color: rgba(47, 122, 97, 0.08);
}

.auth-links a {
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
}

.auth-links a:hover,
.auth-links a:focus-visible {
    transform: translateY(-1px);
    text-decoration-color: currentColor;
}

html[dir="rtl"] .page-auth .auth-panel,
html[dir="rtl"] .page-auth .auth-visual,
html[dir="rtl"] .page-auth .auth-support-panel {
    text-align: right;
}

html[dir="rtl"] .page-auth .field input {
    padding: 24px 52px 10px 56px;
}

html[dir="rtl"] .page-auth .field-icon {
    right: 18px;
    left: auto;
}

html[dir="rtl"] .page-auth .field-label {
    right: 48px;
    left: auto;
}

html[dir="rtl"] .page-auth .password-toggle {
    right: auto;
    left: 10px;
}

html[dir="rtl"] .page-auth .auth-links a:hover,
html[dir="rtl"] .page-auth .auth-links a:focus-visible {
    transform: translateY(-1px);
}

html[dir="rtl"] .page-auth .auth-support-list {
    padding-right: 1.1rem;
    padding-left: 0;
}

html[dir="rtl"] .page-auth .auth-visual::before {
    inset: -18% -12% auto auto;
}

html[dir="rtl"] .page-auth .auth-visual::after {
    inset: auto auto -18% -12%;
}

html[dir="rtl"] .page-auth .auth-visual-copy::after {
    inset: auto auto -18% 6%;
    transform: rotate(-14deg);
}

html[dir="rtl"] .page-auth .auth-visual-orb {
    inset: auto auto 0 10%;
}

html[dir="rtl"] .page-auth .auth-panel::before {
    inset: auto auto -14% -16%;
}

.auth-inline-form .ghost-button {
    min-height: 46px;
}

.auth-panel--logout {
    justify-items: center;
    text-align: center;
}

.auth-panel--logout .auth-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 12px;
    width: min(100%, 460px);
}

.auth-panel--logout .auth-form form,
.auth-panel--logout .auth-form > a {
    flex: 1 1 200px;
    min-width: 180px;
}

.auth-panel--logout .auth-form > a.button-block {
    width: auto;
}

.auth-panel--logout .auth-form .ghost-button {
    width: 100%;
    height: 100%;
    min-height: 50px;
}

.auth-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent),
        linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #ffffff;
    box-shadow: 0 18px 34px rgba(43, 122, 91, 0.24);
}

.auth-status-icon svg {
    width: 30px;
    height: 30px;
}

.auth-danger-button {
    justify-content: center;
    border-color: rgba(220, 53, 69, 0.24);
    background: rgba(220, 53, 69, 0.08);
    color: #ff7280;
}

body[data-theme="1"] .auth-panel--logout .section-kicker {
    border: 1px solid rgba(47, 122, 97, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(225, 238, 231, 0.92)),
        var(--color-primary-pale);
    color: var(--color-primary-dark);
    box-shadow: none;
}

body[data-theme="1"] .auth-panel--logout .auth-danger-button {
    border-color: rgba(197, 109, 94, 0.3);
    background: rgba(197, 109, 94, 0.1);
    color: #b84f5e;
}

.auth-danger-button:hover,
.auth-danger-button:focus-visible {
    border-color: rgba(220, 53, 69, 0.34);
    background: rgba(220, 53, 69, 0.12);
    color: #ff8793;
}

body[data-theme="1"] .auth-panel--logout .auth-danger-button:hover,
body[data-theme="1"] .auth-panel--logout .auth-danger-button:focus-visible {
    border-color: rgba(197, 109, 94, 0.42);
    background: rgba(197, 109, 94, 0.15);
    color: #a94250;
}

.form-errors p {
    margin: 0;
}

.form-errors {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 82, 112, 0.26);
    border-radius: 18px;
    background: rgba(255, 82, 112, 0.08);
    color: #ff8ca2;
}

body[data-theme="1"] .form-errors {
    border-color: rgba(197, 109, 94, 0.18);
    background: rgba(197, 109, 94, 0.1);
    color: #8f4134;
}

.site-body.page-auth .site-footer {
    margin-top: 32px;
}

.auth-consent-wrapper {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 0;
}

.auth-consent-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-height: 0;
    margin-top: 4px;
}

.auth-consent-check {
    position: relative;
    display: inline-flex;
    width: 22px;
    height: 22px;
    min-height: 22px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

body[data-theme="1"] .auth-consent-check {
    border-color: rgba(47, 122, 97, 0.18);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.auth-consent-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-consent-check::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 4px;
    background: transparent;
    transform: scale(0.6);
    opacity: 0;
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.auth-consent-toggle input:checked + .auth-consent-check {
    border-color: rgba(89, 222, 140, 0.72);
    background: rgba(89, 222, 140, 0.12);
    box-shadow: 0 0 0 4px rgba(89, 222, 140, 0.08);
}

.auth-consent-toggle input:checked + .auth-consent-check::after {
    background: #59de8c;
    transform: scale(1);
    opacity: 1;
}

.auth-consent-toggle input:focus-visible + .auth-consent-check {
    border-color: rgba(89, 222, 140, 0.72);
    box-shadow: 0 0 0 4px rgba(89, 222, 140, 0.08);
}

.auth-consent-text {
    font-size: 0.94rem;
    color: var(--text-primary);
    line-height: 1.7;
    user-select: none;
    cursor: pointer;
}

.auth-consent-text strong,
.auth-consent-text b {
    color: var(--text-primary);
}

.auth-consent-panel .auth-consent-link {
    color: #59de8c;
}

.auth-consent-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 700;
}

/* Profile page alignment (scoped strictly to profile page) */
body[data-page="page-account"] .profile-hero,
body[data-page="account"] .profile-hero,
body[data-page="page-account"] .profile-stack,
body[data-page="account"] .profile-stack {
    margin-inline: auto;
}

body[data-page="page-account"] .profile-card__header,
body[data-page="account"] .profile-card__header {
    justify-items: center;
    text-align: center;
}

body[data-page="page-account"] .profile-card__header p,
body[data-page="account"] .profile-card__header p,
body[data-page="page-account"] .profile-hero__lead,
body[data-page="account"] .profile-hero__lead {
    margin: 10px auto 0;
    color: var(--text-secondary);
    max-width: 62ch;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body[data-page="page-account"] .profile-card__body > .solid-button,
body[data-page="account"] .profile-card__body > .solid-button,
body[data-page="page-account"] .profile-card__body > .ghost-button,
body[data-page="account"] .profile-card__body > .ghost-button {
    justify-self: center;
}

@media (max-width: 720px) {
    .page-auth .page-main {
        padding-top: 24px;
    }

    .auth-container {
        width: calc(100% - 24px);
    }

    .auth-shell,
    .auth-shell--compact {
        max-width: none;
    }

    .auth-panel {
        padding: 24px 18px;
        border-radius: 24px;
    }

    .auth-panel h1 {
        font-size: clamp(1.85rem, 8vw, 2.6rem);
    }

    .page-auth .section-kicker {
        width: auto;
    }

    .field input {
        min-height: 62px;
        padding: 24px 54px 10px 52px;
        border-radius: 18px;
    }

    .field-label {
        left: 46px;
    }

    html[dir="rtl"] .page-auth .field-label {
        right: 46px;
    }

    body[data-page="page-account"] .profile-hero,
    body[data-page="account"] .profile-hero {
        align-items: center;
        text-align: center;
    }
}
