/* Shared Account auth shell (Login, Forgot/Reset/Change password) */

.auth-page {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-width: 100%;
    flex: 1 1 auto;
    align-self: stretch;
    min-height: 100svh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 5vh, 48px) 20px;
    box-sizing: border-box;
    background: var(--bg);
    color: var(--text);
    overflow-x: clip;
}

.auth-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(64px);
    opacity: 0.55;
}

.auth-orb-a {
    width: min(52vw, 420px);
    height: min(52vw, 420px);
    top: -12%;
    left: 50%;
    transform: translateX(-55%);
    background: radial-gradient(circle, color-mix(in srgb, #60A5FA 55%, transparent), transparent 70%);
}

.auth-orb-b {
    width: min(40vw, 320px);
    height: min(40vw, 320px);
    bottom: -8%;
    right: 8%;
    background: radial-gradient(circle, color-mix(in srgb, #A78BFA 40%, transparent), transparent 70%);
}

html[data-theme="light"] .auth-orb-a {
    opacity: 0.7;
    background: radial-gradient(circle, color-mix(in srgb, #60A5FA 35%, transparent), transparent 70%);
}

html[data-theme="light"] .auth-orb-b {
    opacity: 0.45;
}

.auth-grid {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image:
        linear-gradient(var(--border2) 1px, transparent 1px),
        linear-gradient(90deg, var(--border2) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
}

html[data-theme="light"] .auth-grid {
    opacity: 0.06;
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.75rem;
    color: #BFDBFE;
    background:
        linear-gradient(160deg, color-mix(in srgb, #60A5FA 22%, var(--surface)) 0%, var(--surface) 100%);
    border: 1px solid color-mix(in srgb, #60A5FA 28%, var(--border));
    box-shadow:
        0 8px 28px rgba(96, 165, 250, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .auth-logo {
    color: #2563EB;
    background: linear-gradient(160deg, #DBEAFE 0%, #EFF6FF 100%);
    border-color: #BFDBFE;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
}

.auth-brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-title {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.auth-sub {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text3);
    font-weight: 500;
}

.auth-card {
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px 24px 26px;
    box-shadow: var(--shadow, 0 16px 48px rgba(0, 0, 0, 0.4));
}

html[data-theme="light"] .auth-card {
    background: color-mix(in srgb, var(--surface) 96%, #fff);
}

.auth-card-head {
    margin-bottom: 24px;
    text-align: left;
}

.auth-card-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.auth-card-desc {
    margin: 8px 0 0;
    font-size: 0.88rem;
    color: var(--text3);
    line-height: 1.45;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.auth-field + .auth-field {
    margin-top: 26px;
}

.auth-field label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text3);
}

.auth-field label i {
    font-size: 0.95rem;
    opacity: 0.9;
    color: #93C5FD;
}

html[data-theme="light"] .auth-field label i {
    color: #2563EB;
}

.auth-input {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border2);
    background: var(--bg);
    color: var(--text);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.35;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.auth-input::placeholder {
    color: var(--text3);
    opacity: 0.7;
}

.auth-input:hover {
    border-color: color-mix(in srgb, var(--border2) 60%, #60A5FA);
}

.auth-input:focus {
    border-color: color-mix(in srgb, #60A5FA 60%, var(--border2));
    box-shadow: 0 0 0 3px color-mix(in srgb, #60A5FA 22%, transparent);
}

select.auth-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2393C5FD' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px;
}

html[data-theme="light"] select.auth-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%232563EB' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}

select.auth-select option {
    background: var(--surface);
    color: var(--text);
}

.auth-field-error,
.auth-errors {
    font-size: 0.82rem;
    color: #FCA5A5;
    margin: 0;
}

html[data-theme="light"] .auth-field-error,
html[data-theme="light"] .auth-errors {
    color: #B91C1C;
}

.auth-errors ul {
    margin: 0;
    padding-left: 1.1rem;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 0.9rem;
    color: var(--text2);
    cursor: pointer;
    user-select: none;
    line-height: 1.3;
}

.auth-checkbox {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #60A5FA;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: #93C5FD;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
    color: #BFDBFE;
}

html[data-theme="light"] .auth-link {
    color: #2563EB;
}

html[data-theme="light"] .auth-link:hover {
    color: #1D4ED8;
}

.auth-submit {
    width: 100%;
    max-width: 100%;
    margin-top: 22px;
    border: none;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 1.02rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
    color: #0F172A;
    background: linear-gradient(180deg, #93C5FD 0%, #60A5FA 100%);
    box-shadow:
        0 4px 16px rgba(96, 165, 250, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.auth-submit i {
    font-size: 1.05rem;
    transition: transform 0.15s ease;
}

.auth-submit:hover {
    filter: brightness(1.06);
    box-shadow:
        0 6px 20px rgba(96, 165, 250, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.auth-submit:hover i {
    transform: translateX(3px);
}

.auth-submit:active {
    transform: scale(0.985);
}

html[data-theme="light"] .auth-submit {
    color: #fff;
    background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.28);
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    background: color-mix(in srgb, #F87171 14%, var(--surface));
    border: 1px solid color-mix(in srgb, #F87171 35%, var(--border));
    color: #FCA5A5;
}

.auth-alert i {
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 1.05rem;
}

html[data-theme="light"] .auth-alert {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #B91C1C;
}

.auth-alert-ok {
    background: color-mix(in srgb, #4ADE80 12%, var(--surface));
    border: 1px solid color-mix(in srgb, #4ADE80 32%, var(--border));
    color: #BBF7D0;
}

html[data-theme="light"] .auth-alert-ok {
    background: #F0FDF4;
    border-color: #BBF7D0;
    color: #166534;
}

.auth-alert-info {
    background: color-mix(in srgb, #60A5FA 12%, var(--surface));
    border: 1px solid color-mix(in srgb, #60A5FA 30%, var(--border));
    color: #BFDBFE;
}

html[data-theme="light"] .auth-alert-info {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1E40AF;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text2);
    text-decoration: none;
    cursor: pointer;
}

.auth-back:hover {
    color: #93C5FD;
    text-decoration: none;
}

html[data-theme="light"] .auth-back:hover {
    color: #2563EB;
}

.auth-body-text {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text2);
    line-height: 1.5;
}

.auth-body-text + .auth-body-text {
    margin-top: 12px;
}

.auth-dev-link {
    display: block;
    margin-top: 16px;
    word-break: break-all;
    font-size: 0.85rem;
    font-weight: 600;
    color: #93C5FD;
    line-height: 1.4;
}

html[data-theme="light"] .auth-dev-link {
    color: #2563EB;
}

@media (max-width: 380px) {
    .auth-card {
        padding: 24px 18px 22px;
    }

    .auth-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
