html:has(.auth-body) {
    background-color: var(--bg-body);
}

html[data-theme="dark"]:has(.auth-body) {
    background-color: #0a0a0a;
}

html.modal-open:has(.auth-body) {
    height: auto;
    min-height: 100dvh;
}

.auth-body {
    background-color: var(--bg-body);
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-5);
    position: relative;
    overflow-x: clip;
    overflow-y: auto;
}

:not([data-theme="dark"]) .auth-body {
    background-image:
        radial-gradient(640px circle at 6% 4%, rgba(59, 130, 246, 0.16), transparent 55%),
        radial-gradient(680px circle at 96% 10%, rgba(99, 102, 241, 0.14), transparent 52%),
        radial-gradient(760px circle at 50% 108%, rgba(14, 165, 233, 0.14), transparent 50%);
}

@media (max-width: 700px) {
    :not([data-theme="dark"]) .auth-body {
        background-image:
            radial-gradient(420px circle at 10% 0%, rgba(59, 130, 246, 0.16), transparent 55%),
            radial-gradient(460px circle at 100% 100%, rgba(99, 102, 241, 0.14), transparent 55%);
    }
}

[data-theme="dark"] .auth-body {
    background-color: #0a0a0a;
    background-image:
        radial-gradient(640px circle at 6% 4%, rgba(59, 130, 246, 0.16), transparent 62%),
        radial-gradient(680px circle at 96% 10%, rgba(99, 102, 241, 0.13), transparent 60%),
        radial-gradient(760px circle at 50% 108%, rgba(14, 165, 233, 0.12), transparent 58%);
}

@media (max-width: 700px) {
    [data-theme="dark"] .auth-body {
        background-image:
            radial-gradient(420px circle at 10% 0%, rgba(59, 130, 246, 0.15), transparent 60%),
            radial-gradient(460px circle at 100% 100%, rgba(99, 102, 241, 0.13), transparent 60%);
    }
}

.back-link {
    position: fixed;
    top: var(--space-6);
    left: var(--space-6);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: var(--transition-base);
    z-index: 10;
    text-decoration: none;
}

.back-link:hover {
    color: var(--primary);
    transform: translateX(-3px);
}

.auth-top-actions {
    position: fixed;
    top: var(--space-5);
    right: var(--space-6);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    margin-top: var(--space-16);
}

.auth-container--register {
    max-width: 580px;
    margin-top: var(--space-12);
}

.auth-container--register .auth-card {
    padding: 24px 32px;
}

.auth-container--register .auth-logo {
    gap: 8px;
    margin-bottom: 4px;
}

.auth-container--register .auth-subtitle {
    margin-bottom: 16px;
}

.auth-container--register .auth-form {
    gap: 12px;
}

.auth-container--register .auth-footer {
    margin-top: 12px;
}

.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: var(--space-12) var(--space-10);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--transition-base);
}

@supports not (backdrop-filter: blur(16px)) {
    .auth-card {
        background: var(--light, #ffffff);
    }

    [data-theme="dark"] .auth-card {
        background: #14161a;
    }
}

.auth-card--leaving {
    opacity: 0;
    transform: scale(0.97) translateY(-6px);
    pointer-events: none;
}

.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.auth-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.auth-wordmark {
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: 1.7rem;
    letter-spacing: 0.12em;
    color: var(--text-main);
}

.auth-logo--settle .auth-wordmark {
    opacity: 0;
    transform: translateY(-30px);
}

.auth-logo--settle.is-visible .auth-wordmark {
    animation: settleDrop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes settleDrop {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }

    50% {
        opacity: 1;
        transform: translateY(5px);
    }

    72% {
        transform: translateY(-2px);
    }

    88% {
        transform: translateY(1px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-logo--draw .auth-wordmark {
    opacity: 0;
    transform: scale(0.9);
}

.auth-logo--draw.is-visible .auth-wordmark {
    animation: wordmarkIn 0.45s ease-out 0.1s forwards;
}

@keyframes wordmarkIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auth-logo--unlock svg {
    opacity: 0;
}

.is-visible .auth-logo--unlock svg {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.auth-logo--unlock .lock-shackle {
    transform-origin: 26px 18px;
    transform: rotate(0deg);
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s;
}

.is-visible .auth-logo--unlock .lock-shackle {
    transform: rotate(-105deg);
}

@keyframes checkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    55% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: var(--space-8);
}

.auth-form {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

#login-form .input-group,
#register-form .input-group,
#reset-form .input-group {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: var(--space-2);
}

.input-group input {
    width: 100%;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition-fast);
    background: var(--light);
    color: var(--text-main);
}

[data-theme="dark"] .input-group input {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

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

.password-wrapper {
    position: relative;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    position: relative;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 5px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    background: var(--light);
    position: relative;
}

[data-theme="dark"] .checkbox-custom {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.15);
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.checkbox-label input[type="checkbox"]:focus-visible+.checkbox-custom {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.checkbox-label input[type="checkbox"]:checked+.checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.checkbox-label input[type="checkbox"]:checked+.checkbox-custom .check-icon {
    opacity: 1;
    transform: scale(1);
}

.checkbox-custom .check-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #fff;
}

.checkbox-custom .check-icon svg {
    width: 11px;
    height: 9px;
    display: block;
}

.forgot-link {
    color: var(--primary);
    font-weight: 600;
}

.auth-btn {
    width: 100%;
    margin-top: 4px;
    font-size: 1.05rem;
}

.auth-footer {
    margin-top: var(--space-8);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 700;
}

.auth-footer+.auth-footer {
    margin-top: 24px;
}

.password-wrapper input {
    padding-right: 40px !important;
}

.toggle-password,
.toggle-password-confirm {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    transition: 0.3s;
}

.toggle-password:hover,
.toggle-password-confirm:hover {
    color: var(--primary);
}

#forgot-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-auth-modal);
    opacity: 0;
    visibility: hidden;
}

#forgot-modal.active {
    opacity: 1;
    visibility: visible;
}

.forgot-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
}

#forgot-modal.active .forgot-modal-content {
    transform: translateY(0);
}

.forgot-modal-content .btn-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.forgot-modal-content .btn-close:hover {
    color: var(--text-main);
}

.forgot-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 20px;
}

[data-theme="dark"] .forgot-icon {
    background: rgba(59, 130, 246, 0.15);
}

.forgot-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

[data-theme="dark"] .forgot-icon.success {
    background: rgba(16, 185, 129, 0.15);
}

.forgot-modal-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px;
}

.forgot-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
}

.forgot-phone-hint {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    padding: 10px 12px;
    margin: -14px 0 18px;
    text-align: left;
}

[data-theme="dark"] .forgot-phone-hint {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.3);
}

.forgot-back-login {
    margin-top: 8px;
}

.hidden {
    display: none !important;
}

.auth-form .input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}

.auth-form .input-row .input-group {
    min-width: 0;
}

.auth-form .input-row input {
    min-width: 0;
}

.auth-form .input-row .input-group:nth-child(3) {
    grid-column: 1 / -1;
}

@media (max-width: 640px) {
    .auth-form .input-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

.profile-field input[readonly] {
    opacity: 0.6;
    cursor: not-allowed;
}

.field-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    opacity: 0.7;
    line-height: 1.3;
}

.input-group:has([required]) label::after {
    content: ' *';
    color: var(--error);
}

.no-required-mark .input-group:has([required]) label::after {
    content: '';
    color: inherit;
}

.ps-wrap {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease, margin 0.35s ease;
    margin-top: 0;
}

.ps-wrap.ps-visible {
    max-height: 300px;
    opacity: 1;
    margin-top: 14px;
}

.ps-meter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ps-meter-bar {
    flex: 1;
    display: flex;
    gap: 4px;
    height: 6px;
    border-radius: 4px;
    transition: box-shadow 0.35s ease;
}

.ps-meter-bar.glow {
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.35);
}

.ps-segment {
    flex: 1;
    height: 100%;
    border-radius: 3px;
    background: var(--border);
    transition: background 0.25s ease;
}

[data-theme="dark"] .ps-segment {
    background: rgba(255, 255, 255, 0.08);
}

.ps-segment.filled {
    background: var(--segment-color, var(--primary));
    animation: segmentPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.ps-segment[data-idx="1"] {
    animation-delay: 0.04s;
}

.ps-segment[data-idx="2"] {
    animation-delay: 0.08s;
}

.ps-segment[data-idx="3"] {
    animation-delay: 0.12s;
}

.ps-segment[data-idx="4"] {
    animation-delay: 0.16s;
}

@keyframes segmentPop {
    0% {
        transform: scaleY(0.3);
        opacity: 0.4;
    }

    55% {
        transform: scaleY(1.18);
    }

    100% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.ps-meter-label {
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
    letter-spacing: 0.02em;
}

.ps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
}

@media (max-width: 420px) {
    .ps-list {
        grid-template-columns: 1fr;
    }
}

.ps-req {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.77rem;
    padding: 3px 0;
    transition: color 0.3s ease;
    user-select: none;
}

.ps-req-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.ps-req-check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #fff;
    z-index: 1;
}

.ps-req-passed .ps-req-check {
    opacity: 1;
    transform: scale(1);
}

.ps-req-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    transition: background 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
    box-sizing: border-box;
}

.ps-req-passed .ps-req-circle {
    background: var(--success, #22c55e);
    border-color: var(--success, #22c55e);
}

.ps-req-fail .ps-req-circle {
    opacity: 0.6;
}

.ps-req-label {
    transition: color 0.3s ease;
    line-height: 1.3;
}

.ps-req-fail {
    color: var(--text-muted);
}

.ps-req-passed {
    color: var(--success, #22c55e);
}

[data-theme="dark"] .ps-req-fail {
    color: rgba(255, 255, 255, 0.62);
}

[data-theme="dark"] .ps-req-passed {
    color: #4ade80;
}

[data-theme="dark"] .ps-req-passed .ps-req-circle {
    background: #22c55e;
    border-color: #22c55e;
}

.ps-req-bounce .ps-req-circle {
    animation: reqBounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes reqBounce {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.3);
    }

    65% {
        transform: scale(0.88);
    }

    100% {
        transform: scale(1);
    }
}

.field-error {
    font-size: 0.75rem;
    font-weight: 500;
    color: #ef4444;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition: max-height 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.field-error.visible {
    max-height: 40px;
    opacity: 1;
    transform: translateY(0);
}

.field-error .error-dot {
    width: 5px;
    height: 5px;
    background: #ef4444;
    border-radius: 50%;
    flex-shrink: 0;
    animation: errorPulse 1.5s ease-in-out infinite;
}

@keyframes errorPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    50%,
    90% {
        transform: translateX(-3px);
    }

    30%,
    70% {
        transform: translateX(3px);
    }
}

.input-group.shake input,
.password-wrapper.shake input {
    animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

[data-theme="dark"] .field-error {
    color: #f87171;
}

[data-theme="dark"] .field-error .error-dot {
    background: #f87171;
}

[data-theme="dark"] .input-group.shake input,
[data-theme="dark"] .password-wrapper.shake input {
    border-color: #f87171 !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15) !important;
}


.input-wrap {
    position: relative;
}

.input-wrap input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    background: var(--card-bg);
    color: var(--text-main);
    outline: none;
}

#email {
    padding: 12px 14px 12px 40px;
}

.input-wrap:has(.toggle-password, .toggle-password-confirm) input {
    padding-right: 44px;
}

[data-theme="dark"] .input-wrap input {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.input-wrap input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 1000px var(--card-bg) inset, 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    background: color-mix(in srgb, var(--card-bg) 98%, var(--primary));
}

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

@supports not (color-mix(in srgb, red, blue)) {
    .input-wrap input:focus {
        background: var(--card-bg);
    }
}

[data-theme="dark"] .input-wrap input:focus {
    box-shadow: 0 0 0 1000px var(--card-bg) inset, 0 0 0 3px rgba(96, 165, 250, 0.2) !important;
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .input-wrap input:focus-visible {
    outline-color: #60a5fa;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 1;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.input-wrap:focus-within .input-icon {
    color: var(--primary);
}

.input-wrap .toggle-password,
.input-wrap .toggle-password-confirm {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.toggle-password i.anim-pop,
.toggle-password-confirm i.anim-pop {
    animation: iconEyePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.input-wrap:focus-within .toggle-password i,
.input-wrap:focus-within .toggle-password-confirm i {
    animation: pulse-eye 0.5s ease-out;
}

@keyframes iconEyePop {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.25);
    }

    65% {
        transform: scale(0.88);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes pulse-eye {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    40% {
        transform: scale(1.25);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#forgot-form {
    gap: 0;
}

#forgot-form>.input-group+#forgot-turnstile,
#forgot-form>.input-group+.turnstile-wrap {
    margin-top: 8px;
}

#forgot-form>#forgot-turnstile+.auth-btn,
#forgot-form>.turnstile-wrap+.auth-btn {
    margin-top: 16px;
}

.turnstile-wrap {
    position: relative;
    min-height: 65px;
}

.turnstile-skel {
    position: absolute;
    inset: 0;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: opacity 0.25s ease, border-color 0.2s ease, background-color 0.2s ease;
    z-index: 1;
    opacity: 1;
    overflow: hidden;
}

.turnstile-skel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: skelShimmer 1.6s ease-in-out infinite;
    pointer-events: none;
}

[data-theme="dark"] .turnstile-skel {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .turnstile-skel::after {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.06) 50%, transparent 100%);
}

.turnstile-skel.is-error {
    justify-content: space-between;
    gap: 10px;
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.28);
    color: var(--text-main, #1f2937);
}

[data-theme="dark"] .turnstile-skel.is-error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.32);
    color: rgba(255, 255, 255, 0.88);
}

.turnstile-skel.is-error::after {
    animation: none;
    display: none;
}

.turnstile-error-msg {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.76rem;
    line-height: 1.3;
    text-align: left;
    min-width: 0;
}

.turnstile-error-msg i {
    color: #ef4444;
    font-size: 0.88rem;
    flex-shrink: 0;
}

.turnstile-retry-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid var(--border);
    background: var(--white, #ffffff);
    color: var(--text-main, #111827);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.turnstile-retry-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.turnstile-retry-btn:active {
    transform: scale(0.97);
}

[data-theme="dark"] .turnstile-retry-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: #f3f4f6;
}

[data-theme="dark"] .turnstile-retry-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.turnstile-skel .skel-pulse {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    animation: skelPulse 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

.turnstile-skel.loaded {
    display: none;
}

@keyframes skelShimmer {
    100% {
        transform: translateX(100%);
    }
}

@keyframes skelPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

#forgot-modal {
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

#forgot-modal .forgot-modal-content {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#forgot-modal:not(.active) .forgot-modal-content {
    transform: translateY(24px) scale(0.97);
}

/* Email / Phone mode switcher & international phone input */
.auth-mode-switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 2px;
    isolation: isolate;
}

[data-theme="dark"] .auth-mode-switch {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.auth-mode-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    border-radius: 9px;
    background: var(--card-bg, #ffffff);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1), width 0.35s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.15s ease;
    will-change: transform, width;
}

[data-theme="dark"] .auth-mode-indicator {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
}

.auth-mode-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.auth-mode-btn:hover {
    color: var(--text-main);
}

.auth-mode-btn.active {
    background: transparent;
    color: var(--text-main);
    box-shadow: none;
}

[data-theme="dark"] .auth-mode-btn.active {
    background: transparent;
    color: #ffffff;
    box-shadow: none;
}

.auth-contact-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.auth-field-panel {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(14px);
    transition: opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.24s;
}

.auth-field-panel:first-child {
    transform: translateX(-14px);
}

.auth-field-panel.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.label-optional {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-left: 4px;
}

.phone-input-group {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
}

.phone-input-group .custom-select-wrapper {
    width: 100%;
    min-width: 0;
}

.phone-input-group .custom-select-trigger {
    height: 100%;
    min-height: 46px;
    padding: 0 30px 0 10px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.phone-input-group .custom-select-arrow {
    right: 9px;
}

.phone-input-group input[type="tel"] {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    background: var(--card-bg);
    color: var(--text-main);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

[data-theme="dark"] .phone-input-group input[type="tel"] {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.phone-input-group input[type="tel"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

@media (max-width: 600px) {
    .auth-body {
        padding: 0;
        align-items: flex-start;
    }

    .back-link {
        top: 16px;
        left: 16px;
        font-size: 0.85rem;
        z-index: 10;
    }

    .auth-top-actions {
        top: 10px;
        right: 14px;
        gap: 6px;
    }

    .auth-top-actions .icon-btn {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    .auth-container,
    .auth-container--register {
        max-width: none;
        margin-top: 0;
    }

    .auth-card,
    .auth-container--register .auth-card {
        padding: 56px 24px 32px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        min-height: 100dvh;
        box-shadow: none;
    }

    #forgot-modal {
        align-items: flex-end;
        padding: 0;
    }

    .forgot-modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 22px 22px 0 0;
        padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0));
        max-height: calc(100dvh - 25px);
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateY(100%);
    }

    .forgot-modal-content::before {
        content: '';
        display: block;
        width: 38px;
        height: 4px;
        background: rgba(255, 255, 255, 0.22);
        border-radius: 2px;
        margin: -0.35rem auto 0.75rem;
        flex-shrink: 0;
    }

    [data-theme="light"] .forgot-modal-content::before,
    :not([data-theme="dark"]) .forgot-modal-content::before {
        background: rgba(0, 0, 0, 0.18);
    }

    #forgot-modal:not(.active) .forgot-modal-content {
        transform: translateY(100%);
    }

    #forgot-modal.active .forgot-modal-content {
        transform: translateY(0);
    }

    #forgot-modal.closing .forgot-modal-content {
        transform: translateY(100%);
        transition: transform 0.25s ease;
    }

    .forgot-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
        margin: 0 auto 10px;
    }

    .forgot-modal-content h3 {
        font-size: 1.15rem;
        margin-bottom: 6px;
    }

    .forgot-desc {
        font-size: 0.85rem;
        margin-bottom: 14px;
        line-height: 1.4;
    }

    .forgot-modal-content .input-group input {
        font-size: 16px !important;
        padding: 11px 14px;
    }

    .forgot-modal-content .auth-btn {
        min-height: 48px;
        font-size: 0.95rem;
    }

    .forgot-modal-content .btn-close {
        top: 14px;
        right: 14px;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
    }

    [data-theme="dark"] .auth-card {
        box-shadow: none;
    }

    .auth-logo h1 {
        font-size: 1.5rem;
    }

    .auth-subtitle {
        font-size: 0.9rem;
        margin-bottom: 24px;
    }

    .input-group input {
        padding: 12px 14px;
        font-size: 16px;
    }

    .form-options {
        font-size: 0.8rem;
        flex-wrap: wrap;
        gap: 6px;
    }

    .auth-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .input-wrap input,
    #email {
        padding: 10px 12px 10px 38px;
        font-size: 16px;
    }

    .input-wrap:has(.toggle-password, .toggle-password-confirm) input {
        padding-right: 40px;
    }

    .input-icon {
        left: 12px;
        font-size: 0.85rem;
    }

    .input-wrap .toggle-password,
    .input-wrap .toggle-password-confirm {
        right: 12px;
    }
}

@media (max-width: 420px) {
    .phone-input-group {
        grid-template-columns: 114px minmax(0, 1fr);
        gap: 6px;
    }

    .phone-input-group .custom-select-trigger {
        min-height: 42px;
        padding: 0 28px 0 8px;
        font-size: 0.84rem;
    }

    .phone-input-group .custom-select-arrow {
        right: 8px;
    }

    .phone-input-group input[type="tel"] {
        padding: 10px 12px;
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .auth-card,
    .auth-card--leaving,
    .auth-logo,
    [data-animate],
    .shake,
    .anim-pop,
    .turnstile-skel .skel-pulse,
    .turnstile-skel::after,
    #forgot-modal .forgot-modal-content {
        animation: none !important;
        transition: none !important;
    }

    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
    }

    .auth-mode-indicator,
    .auth-field-panel,
    .auth-logo--unlock svg,
    .auth-logo--unlock .lock-shackle,
    #forgot-modal,
    .turnstile-skel {
        transition: none !important;
    }

    .auth-logo--unlock svg {
        opacity: 1 !important;
    }

    .auth-field-panel {
        transform: none !important;
    }
}

.ps-match-hint {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 500;
}

.ps-match-hint.is-visible {
    display: flex;
}

.ps-match-hint.is-match {
    color: var(--success, #16a34a);
}

.ps-match-hint.is-mismatch {
    color: var(--danger, #dc2626);
}

.resend-confirm-box {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.18);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.resend-confirm-box.hidden {
    display: none;
}

.resend-confirm-box p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

[data-theme="dark"] .resend-confirm-box {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.28);
}

/* --- Google OAuth Button & Divider --- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.9rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: lowercase;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-google-oauth {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.82rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.14s ease, box-shadow 0.16s ease;
}

.btn-google-oauth:hover:not(:disabled) {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] .btn-google-oauth {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .btn-google-oauth:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.24);
}

.btn-google-oauth:active:not(:disabled) {
    transform: scale(0.985);
}

.btn-google-oauth:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.google-oauth-icon {
    flex-shrink: 0;
}
