/* Auth styles */
/* Sections: base tokens, legacy/register layout, modern auth, overlays, utilities */
:root {
    /* Legacy/register palette */
    --background: #ffffff;
    --foreground: #212529;
    --primary: #ea384c;
    --primary-hover: #d3273b;
    --primary-foreground: #ffffff;
    --secondary: #f6f6f6;
    --secondary-foreground: #333333;
    --muted: #f6f6f6;
    --muted-foreground: #71717a;
    --accent: #f6f6f6;
    --accent-foreground: #333333;
    --destructive: #ea384c;
    --destructive-foreground: #ffffff;
    --border: #e4e4e7;
    --input: #e4e4e7;
    --radius: 1rem;
    --card-background: rgba(255,255,255,0.82);
    --card-foreground: #333333;
    --card-shadow: 0 6px 30px rgba(16,24,40,0.06);
    --glass-border: rgba(255,255,255,0.45);
    --success: #22c55e;
    --strength-weak: #ff6b6b;
    --strength-medium: #f59e0b;
    --strength-strong: #22c55e;

    /* Modern auth palette (login/reset) */
    --auth-bg: #ffffff;
    --auth-ink: #111827;
    --auth-muted: #6b7280;
    --auth-border: #e5e7eb;
    --auth-card: rgba(255,255,255,0.95);
    --auth-primary: #0f172a;
    --auth-primary-hover: #111827;
    --auth-accent: #1d4ed8;
    --auth-accent-soft: #dbeafe;
    --auth-input-bg: #f9fafb;
    --auth-overlay: rgba(15,23,42,0.35);

    /* Brand tokens (align with main.min.css) */
    --brand-dark: #172554;
    --brand-red: #FF3B30;
    --brand-blue: #38BDF8;
    --brand-blueLight: #BAE6FD
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html,body {
    height: 100%
}

body {
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    background: var(--background);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: 0.18s ease
}

a:hover {
    text-decoration: underline
}

.hidden {
    display: none
}

.rule-item {
    font-size: 13px;
    margin: 4px 0;
    color: var(--destructive)
}

.rule-item.valid {
    color: var(--success)
}

.rule-item::before {
    content: "âœ– "
}

.rule-item.valid::before {
    content: "âœ” "
}

.auth-layout {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: var(--background)
}

.auth-layout::before {
    content: "";
    position: absolute;
    inset: 0;
    height: 14rem;
    background: linear-gradient(to bottom,rgba(234,56,76,0.06),transparent);
    z-index: 0;
    pointer-events: none
}

.background-accent {
    position: absolute;
    width: 24rem;
    height: 24rem;
    background: rgba(234,56,76,0.09);
    border-radius: 50%;
    filter: blur(3rem);
    opacity: 0.28;
    animation: pulse 6s ease-in-out infinite;
    z-index: 0
}

.top-right {
    top: -80px;
    right: -80px
}

.bottom-left {
    bottom: -80px;
    left: -80px
}

.bg-pattern {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ea384c' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")
}

#loadingOverlay .overlay-background {
    position: fixed;
    inset: 0;
    background-color: rgba(255,255,255,0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999
}

.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.toast {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    max-width: 420px;
    width: 90%;
    background: var(--foreground);
    color: var(--background);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 12px 30px rgba(2,6,23,0.12);
    z-index: 100;
    transform: translateY(1rem);
    transition: all .28s ease
}

.toast.hidden {
    transform: translateY(200%);
    opacity: 0;
    visibility: hidden
}

.toast-title {
    font-weight: 700;
    font-size: 0.95rem
}

.toast-description {
    font-size: 0.85rem;
    opacity: .95
}

.success-container {
    text-align: center;
    padding: 1rem 0
}

.success-icon {
    width: 64px;
    height: 64px;
    background: rgba(234,56,76,0.08);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem
}

.profile-upload {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem
}

.profile-image-container {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--secondary);
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(2,6,23,0.06)
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.profile-upload-icon {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: var(--primary);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid #fff;
    transition: transform .18s ease;
    z-index: 9
}

.profile-upload-icon:hover {
    transform: translateY(-3px)
}

.auth-wrapper {
    display: flex;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    z-index: 2
}

.auth-image {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: block
}

.auth-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,rgba(0,0,0,0.18),transparent);
    pointer-events: none
}

.auth-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .9s cubic-bezier(.2,.9,.2,1)
}

.auth-image img:hover {
    transform: scale(1.04)
}

.auth-container {
    flex: 1;
    max-width: 520px;
    width: 100%;
    background: var(--card-background);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 48px 56px;
    position: relative;
    box-shadow: -8px 0 40px rgba(2,6,23,0.06);
    border-left: 1px solid var(--glass-border);
    overflow-y: auto;
    height: 100vh;
    scroll-behavior: smooth
}

.header {
    text-align: center;
    margin-bottom: 18px
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em
}

.header p {
    color: var(--muted-foreground);
    margin-top: 6px
}

.toggle-message {
    text-align: center;
    margin-bottom: 18px;
    font-size: 0.95rem;
    color: var(--muted-foreground)
}

.toggle-message a {
    color: var(--primary);
    font-weight: 700
}

.toggle-message a:hover {
    text-decoration: underline
}

.auth-card {
    padding: 20px;
    border-radius: 14px;
    background: transparent;
    border: none;
    box-shadow: none
}

.auth-container .auth-card {
    margin-top: 2rem;
    margin-bottom: 2rem
}

.form {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.password-input-container {
    position: relative
}

.auth-input {
    background: var(--secondary);
    border: none;
    border-radius: 10px;
    padding: 12px 14px;
    width: 100%;
    transition: box-shadow .18s ease,transform .12s ease;
    font-size: 1rem;
    color: var(--foreground)
}

.auth-input::placeholder {
    color: var(--muted-foreground);
    opacity: .85
}

.auth-input:focus {
    outline: none;
    box-shadow: 0 8px 24px rgba(16,24,40,0.06);
    transform: translateY(-1px)
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    font-size: 1rem;
    padding: 6px
}

.toggle-password:hover {
    color: var(--foreground)
}

.error-message {
    font-size: 0.78rem;
    color: var(--destructive);
    margin-top: 4px
}

.forgot-password {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px
}

.auth-submit-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    margin-top: 10px;
    background: linear-gradient(180deg,var(--primary),var(--primary-hover));
    color: var(--primary-foreground);
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform .12s ease,box-shadow .12s ease
}

.auth-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(234,56,76,0.18)
}

.auth-submit-button:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none
}

.auth-divider {
    display: flex;
    align-items: center;
    font-size: 0.78rem;
    color: var(--muted-foreground);
    margin: 18px 0
}

.auth-divider::before,.auth-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--border)
}

.auth-divider::before {
    margin-right: .75rem
}

.auth-divider::after {
    margin-left: .75rem
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.social-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
    background: var(--background);
    border: 1px solid var(--border);
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s ease,box-shadow .12s ease
}

.social-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(2,6,23,0.06)
}

.signup-link {
    margin-top: 12px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted-foreground)
}

.footer {
    position: relative;
    z-index: 10;
    margin-top: 18px;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-align: center
}

.password-strength {
    margin-top: 6px
}

.strength-bar {
    height: 6px;
    background: var(--secondary);
    border-radius: 999px;
    overflow: hidden
}

.strength-progress {
    height: 100%;
    width: 0;
    background: var(--strength-weak);
    transition: width .28s ease,background .28s ease
}

.strength-text {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--muted-foreground)
}

@media (min-width: 640px) {
    .social-buttons {
        flex-direction:row
    }
}

@media (max-width: 900px) {
    .auth-wrapper {
        flex-direction:column;
        height: auto;
        min-height: 100vh
    }

    .auth-image {
        display: none
    }

    .auth-container {
        max-width: 100%;
        width: 100%;
        height: auto;
        min-height: 100vh;
        padding: 2rem 1.5rem;
        border-left: none;
        box-shadow: none;
        background: var(--background)
    }
}

@media (max-width: 420px) {
    .auth-container {
        padding:20px 14px
    }

    .header h1 {
        font-size: 1.3rem
    }
}

@keyframes pulse {
    0%,100% {
        opacity: .26
    }

    50% {
        opacity: .18
    }
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes slideDown {
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.animate-fade-in {
    opacity: 0;
    animation: fadeIn .32s ease-out forwards
}

.animate-slide-up {
    opacity: 0;
    transform: translateY(8px);
    animation: slideUp .36s cubic-bezier(.16,1,.3,1) forwards
}

.animate-slide-down {
    opacity: 0;
    transform: translateY(-8px);
    animation: slideDown .36s cubic-bezier(.16,1,.3,1) forwards
}

/* Accessibility focus */
.auth-input:focus,.social-button:focus,.auth-submit-button:focus {
    outline: 3px solid rgba(234,56,76,0.12);
    outline-offset: 2px
}

/* small helpers */
.center {
    text-align: center
}

.muted {
    color: var(--muted-foreground)
}

/* make sure file inputs invisible but accessible */
input[type=file].hidden {
    position: absolute!important;
    left: -9999px!important;
    top: auto!important;
    width: 1px!important;
    height: 1px!important;
    overflow: hidden!important
}

.profile-image-container:focus-within {
    box-shadow: 0 8px 28px rgba(16,24,40,0.08)
}

/* subtle rounded page edges on large screens */
@media (min-width: 1200px) {
    .auth-container {
        border-top-right-radius:18px;
        border-bottom-right-radius: 18px
    }

    .auth-image img {
        border-top-left-radius: 18px;
        border-bottom-left-radius: 18px
    }
}

/* small print */
.legal-text {
    font-size: 13px;
    color: #5b6270;
    margin-top: 14px
}

/* ensure captcha centered on small screens */
.g-recaptcha,
.cf-turnstile {
    transform-origin: center;
    display: flex;
    justify-content: center;
    margin-top: 8px;
    margin-bottom: 8px
}

/* Modern auth pages (login/reset/forgot) */
[data-theme="dark"] {
    --auth-bg: #1e1e1e;
    --auth-ink: #f8fafc;
    --auth-muted: #94a3b8;
    --auth-border: rgba(148, 163, 184, 0.25);
    --auth-card: rgba(15, 23, 42, 0.6);
    --auth-primary: #f8fafc;
    --auth-primary-hover: #ffffff;
    --auth-accent: #60a5fa;
    --auth-accent-soft: rgba(96, 165, 250, 0.2);
    --auth-input-bg: rgba(15, 23, 42, 0.6);
    --auth-overlay: rgba(2, 6, 23, 0.72)
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --auth-bg: #1e1e1e;
        --auth-ink: #f8fafc;
        --auth-muted: #94a3b8;
        --auth-border: rgba(148, 163, 184, 0.25);
        --auth-card: rgba(15, 23, 42, 0.6);
        --auth-primary: #f8fafc;
        --auth-primary-hover: #ffffff;
        --auth-accent: #60a5fa;
        --auth-accent-soft: rgba(96, 165, 250, 0.2);
        --auth-input-bg: rgba(15, 23, 42, 0.6);
        --auth-overlay: rgba(2, 6, 23, 0.72)
    }
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 52px 20px;
    position: relative;
    background: var(--auth-bg);
    color: var(--auth-ink);
    font-family: "Outfit","Plus Jakarta Sans","Patrick Hand",sans-serif
}

.auth-page::before,
.auth-page::after {
    content: none
}

/* Login page (homepage-inspired) */
.auth-page--landing {
    --auth-primary: var(--brand-dark);
    --auth-primary-hover: var(--brand-dark);
    --auth-accent: var(--brand-red);
    --auth-accent-soft: rgba(255,59,48,0.16);
    --auth-border: var(--brand-dark);
    --auth-muted: rgba(23,37,84,0.7);
    --auth-input-bg: #ffffff;
    --auth-card: #ffffff;
    background-image: radial-gradient(var(--brand-blueLight) 1px,transparent 1px);
    background-size: 22px 22px;
    overflow: hidden
}

.auth-page--landing::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,rgba(186,230,253,0.45),rgba(255,255,255,0.85) 45%,rgba(255,255,255,1));
    z-index: 0;
    pointer-events: none
}

[data-theme="dark"] .auth-page--landing {
    --auth-primary: #f8fafc;
    --auth-primary-hover: #ffffff;
    --auth-accent: var(--brand-blue);
    --auth-accent-soft: rgba(56,189,248,0.2);
    --auth-border: rgba(248,250,252,0.7);
    --auth-muted: rgba(248,250,252,0.7);
    --auth-input-bg: rgba(15,23,42,0.85);
    --auth-card: rgba(2,6,23,0.7);
    background-image: radial-gradient(rgba(56,189,248,0.15) 1px,transparent 1px)
}

[data-theme="dark"] .auth-page--landing::before {
    background: linear-gradient(135deg,rgba(2,6,23,0.92),rgba(15,23,42,0.88))
}

.auth-shell {
    width: min(620px,94vw);
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 36px 40px 32px;
    position: relative;
    z-index: 1;
    animation: authPop .6s ease
}

.auth-shell--landing {
    background: var(--auth-card);
    border: 2px solid var(--auth-primary);
    border-radius: 24px;
    box-shadow: 6px 6px 0 var(--auth-primary);
    padding: 34px 36px 30px
}

.auth-page--landing .auth-brand {
    font-weight: 800;
    letter-spacing: .01em
}

.auth-page--landing .auth-kicker {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    border: 2px solid var(--auth-primary);
    background: var(--brand-blueLight);
    font-weight: 700
}

[data-theme="dark"] .auth-page--landing .auth-kicker {
    background: rgba(56,189,248,0.2)
}

.auth-page--landing .auth-headline h1 {
    font-size: 32px;
    font-weight: 800
}

.auth-page--landing .auth-headline h1 span {
    color: var(--brand-red)
}

.auth-shell-narrow {
    width: min(540px,92vw)
}

.auth-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 26px
}

.auth-shell-narrow .auth-header {
    gap: 8px;
    margin-bottom: 22px
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--auth-primary)
}

.auth-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: transparent;
    padding: 0;
    object-fit: contain
}

.auth-headline {
    display: none
}

.auth-shell[data-auth-state="login"] .auth-headline-login,
.auth-shell[data-auth-state="signup"] .auth-headline-signup,
.auth-shell[data-auth-state="forgot"] .auth-headline-forgot {
    display: block
}

.auth-kicker {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--auth-muted)
}

.auth-headline h1 {
    margin: 8px 0 6px;
    font-family: "Outfit","Plus Jakarta Sans",sans-serif;
    font-size: 30px;
    line-height: 1.2;
    color: var(--auth-primary)
}

.auth-headline h1 span {
    color: var(--auth-accent)
}

.auth-headline p {
    margin: 0;
    color: var(--auth-muted)
}

.auth-header > h1 {
    margin: 0;
    font-family: "Outfit","Plus Jakarta Sans",sans-serif;
    font-size: 28px;
    color: var(--auth-primary)
}

.auth-shell-narrow .auth-header > h1 {
    font-size: 28px
}

.auth-header > p {
    margin: 0;
    color: var(--auth-muted)
}

.auth-providers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px
}

.auth-provider-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    letter-spacing: .01em
}

.auth-provider {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    position: relative;
    border-radius: 16px;
    border: 1px solid var(--auth-border);
    text-decoration: none;
    color: var(--auth-primary);
    background: var(--auth-card);
    font-weight: 600;
    transition: transform .2s ease,box-shadow .2s ease,border-color .2s ease
}

.auth-provider i,
.auth-provider img {
    font-size: 20px;
    width: 20px;
    height: 20px
}

.auth-provider:hover {
    transform: translateY(-2px);
    border-color: rgba(29,78,216,.35);
    box-shadow: 0 12px 24px rgba(15,23,42,.12)
}

.auth-page--landing .auth-provider {
    border-width: 2px;
    background: var(--auth-card);
    box-shadow: 2px 2px 0 var(--auth-primary)
}

.auth-page--landing .auth-provider:hover {
    border-color: var(--auth-primary);
    box-shadow: 6px 6px 0 var(--auth-primary)
}

.auth-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 999px;
    padding: 12px 16px;
    border: 1px dashed rgba(15,23,42,.25);
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 18px;
    transition: border-color .2s ease,color .2s ease
}

.auth-ghost:hover {
    border-color: var(--auth-accent);
    color: var(--auth-accent)
}

.auth-page--landing .auth-ghost {
    border-style: solid;
    border-width: 2px;
    box-shadow: 2px 2px 0 var(--auth-primary);
    background: var(--auth-card)
}

.auth-page--landing .auth-ghost:hover {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
    box-shadow: 6px 6px 0 var(--auth-primary)
}

.auth-page .auth-divider {
    position: relative;
    text-align: center;
    margin: 18px 0 20px;
    color: var(--auth-muted);
    font-size: 13px
}

.auth-page .auth-divider::before,
.auth-page .auth-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: rgba(15,23,42,.12)
}

.auth-page .auth-divider::before {
    left: 0
}

.auth-page .auth-divider::after {
    right: 0
}

.auth-page .auth-divider span {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding: 0 10px;
    background: var(--auth-bg)
}

.auth-page--landing .auth-divider::before,
.auth-page--landing .auth-divider::after {
    background: var(--auth-primary);
    opacity: .2
}

.auth-shell[data-auth-state="forgot"] .auth-providers,
.auth-shell[data-auth-state="forgot"] .auth-divider,
.auth-shell[data-auth-state="forgot"] .auth-ghost {
    display: none
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px
}

.auth-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px
}

.auth-field label {
    display: block;
    font-size: 12px;
    color: var(--auth-muted);
    margin-bottom: 6px
}

.auth-field input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--auth-border);
    background: var(--auth-input-bg);
    font-size: 14px;
    transition: border-color .2s ease,box-shadow .2s ease
}

.auth-field input:focus {
    outline: none;
    border-color: rgba(29,78,216,.5);
    box-shadow: 0 0 0 3px rgba(29,78,216,.12);
    background: var(--auth-card)
}

.auth-page--landing .auth-field input {
    border-width: 2px;
    border-color: var(--auth-primary);
    box-shadow: 2px 2px 0 var(--auth-primary)
}

.auth-page--landing .auth-field input:focus {
    box-shadow: 3px 3px 0 var(--auth-primary)
}

.auth-password {
    display: flex;
    align-items: center;
    gap: 10px
}

.auth-password button {
    border: none;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px
}

.auth-password button:hover {
    color: var(--auth-primary);
    background: rgba(15,23,42,.06)
}

.auth-form small {
    color: var(--auth-muted);
    font-size: 12px
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    border-radius: 14px;
    padding: 13px 18px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg,#0f172a,#1f2937);
    cursor: pointer;
    transition: transform .2s ease,box-shadow .2s ease
}

.auth-submit:disabled {
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: .85
}

.auth-submit.is-loading {
    cursor: wait
}

.auth-submit__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    visibility: hidden;
    animation: spin .8s linear infinite
}

.auth-submit.is-loading .auth-submit__spinner {
    visibility: visible
}

[data-theme="dark"] .auth-submit {
    background: #444444
}

[data-theme="dark"] .auth-submit:hover {
    box-shadow: 0 12px 22px rgba(0,0,0,.45)
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(15,23,42,.18)
}

.auth-page--landing .auth-submit {
    background: var(--brand-red);
    border: 2px solid var(--auth-primary);
    box-shadow: 4px 4px 0 var(--auth-primary)
}

.auth-page--landing .auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 8px 8px 0 var(--auth-primary)
}

.auth-page--landing .auth-submit:disabled {
    box-shadow: 2px 2px 0 var(--auth-primary);
    opacity: .75
}

.auth-submit-outline {
    background: transparent;
    color: var(--auth-primary);
    border: 1px solid var(--auth-border)
}

.auth-submit-ghost {
    background: var(--auth-input-bg);
    color: var(--auth-primary)
}

.auth-foot {
    display: flex;
    gap: 6px;
    justify-content: center;
    font-size: 13px;
    color: var(--auth-muted)
}

.auth-shell-narrow .auth-foot {
    margin-top: 10px
}

.auth-link {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 600
}

.auth-link:hover {
    text-decoration: underline
}

.auth-legal {
    text-align: center;
    font-size: 12px;
    color: var(--auth-muted)
}

.auth-legal a {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 600
}

.auth-alert {
    display: none;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid rgba(185,28,28,.2)
}

.auth-shell-narrow .auth-alert {
    margin-bottom: 14px
}

.auth-alert.success {
    background: #ecfdf5;
    color: #047857;
    border-color: rgba(4,120,87,.25)
}

.auth-alert.error {
    display: block
}

.auth-resend {
    display: flex;
    justify-content: center
}

.auth-link-button {
    border: none;
    background: transparent;
    color: var(--auth-accent);
    font-weight: 600;
    cursor: pointer
}

.auth-captcha {
    display: flex;
    justify-content: center
}

.auth-footnote {
    font-size: 13px;
    color: var(--auth-muted);
    margin-bottom: 12px
}

.auth-footer {
    text-align: center;
    margin-top: 26px;
    font-size: 12px;
    color: var(--auth-muted)
}

.auth-loading,
.auth-success-overlay {
    position: fixed;
    inset: 0;
    background: var(--auth-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999
}

.auth-loading-card,
.auth-success-card {
    background: var(--auth-card);
    border-radius: 20px;
    padding: 26px 30px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(15,23,42,.2);
    width: min(420px,90vw)
}

.auth-page .spinner {
    width: 36px;
    height: 36px;
    border-width: 3px;
    border-color: rgba(15,23,42,.1);
    border-top-color: var(--auth-accent);
    margin: 0 auto 12px
}

[data-theme="dark"] .auth-page .spinner {
    border-color: rgba(248,250,252,.2);
    border-top-color: var(--auth-accent)
}

.auth-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--auth-accent-soft);
    color: var(--auth-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px
}

.auth-success-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center
}

.page-loader {
    position: fixed;
    inset: 0;
    background: var(--auth-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity .3s ease,visibility .3s ease
}

.page-loader--hide {
    opacity: 0;
    visibility: hidden
}

.page-loader-card {
    text-align: center;
    color: var(--auth-muted);
    font-size: 14px
}

[data-theme="dark"] .auth-provider {
    border-color: rgba(148,163,184,.35)
}

[data-theme="dark"] .auth-provider:hover {
    box-shadow: 0 12px 24px rgba(2,6,23,.5)
}

[data-theme="dark"] .auth-alert {
    background: rgba(220,38,38,.15);
    color: #fecaca;
    border-color: rgba(248,113,113,.4)
}

[data-theme="dark"] .auth-alert.success {
    background: rgba(16,185,129,.15);
    color: #a7f3d0;
    border-color: rgba(52,211,153,.3)
}

.auth-help {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 10001
}

.auth-help-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--auth-border);
    background: var(--auth-card);
    color: var(--auth-primary);
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(15,23,42,.15)
}

.auth-help-menu {
    position: absolute;
    right: 0;
    bottom: 56px;
    min-width: 220px;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 18px 40px rgba(15,23,42,.18);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .2s ease,transform .2s ease
}

.auth-help-menu::after {
    content: "";
    position: absolute;
    right: 16px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    background: var(--auth-card);
    border-right: 1px solid var(--auth-border);
    border-bottom: 1px solid var(--auth-border);
    transform: rotate(45deg)
}

.auth-help-open .auth-help-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto
}

.auth-help-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--auth-muted);
    margin-bottom: 8px
}

.auth-help-item,
.auth-help-link {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--auth-primary);
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none
}

.auth-help-item:hover,
.auth-help-link:hover {
    background: rgba(15,23,42,.08)
}

[data-theme="dark"] .auth-help-item:hover,
[data-theme="dark"] .auth-help-link:hover {
    background: rgba(148,163,184,.16)
}

.auth-help-divider {
    height: 1px;
    background: var(--auth-border);
    margin: 8px 0
}

@keyframes authPop {
    from {
        opacity: 0;
        transform: translateY(16px) scale(.98)
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

@media (max-width: 640px) {
    .auth-shell {
        padding: 28px 22px 26px
    }

    .auth-shell--landing {
        padding: 26px 20px 24px;
        box-shadow: 4px 4px 0 var(--auth-primary)
    }

    .auth-providers {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }

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

    .auth-headline h1 {
        font-size: 26px
    }
}

/* Register success overlay */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn .3s ease;
    background: radial-gradient(circle at 20% 20%,rgba(34,197,94,.35),transparent 55%),radial-gradient(circle at 80% 10%,rgba(16,185,129,.25),transparent 50%),linear-gradient(135deg,#0f9b4f 0%,#047857 100%)
}

.success-card {
    position: relative;
    background: rgba(255,255,255,.97);
    border-radius: 24px;
    width: min(560px,92vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 70px rgba(6,95,70,.4);
    display: flex;
    flex-direction: column;
    padding: 42px 36px 38px;
    text-align: center
}

.animate-scale-in {
    animation: scaleIn .4s cubic-bezier(.34,1.56,.64,1)
}

@keyframes scaleIn {
    from {
        transform: scale(.8);
        opacity: 0
    }

    to {
        transform: scale(1);
        opacity: 1
    }
}

.success-overlay .success-icon {
    width: 112px;
    height: 112px;
    margin: 0 auto 18px;
    border-radius: 999px;
    background: #22c55e;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    box-shadow: 0 16px 40px rgba(34,197,94,.35)
}

.success-overlay h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.3;
    color: #064e3b
}

.success-message {
    font-size: 18px;
    color: #14532d;
    text-align: center;
    margin: 12px 0 16px;
    font-weight: 600
}

.success-email {
    font-weight: 700;
    color: #166534;
    font-size: 16px;
    word-break: break-all;
    padding: 10px 12px;
    background: #ecfdf5;
    border-radius: 10px;
    border: 1px solid #bbf7d0;
    margin: 0 0 24px
}

.btn-resend {
    background: #16a34a;
    color: #ffffff;
    border: none;
    padding: 14px 34px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: all .3s ease;
    font-size: 15px;
    letter-spacing: .6px;
    text-transform: uppercase;
    box-shadow: 0 12px 26px rgba(22,163,74,.35)
}

.btn-resend:hover {
    background: #15803d;
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(21,128,61,.35)
}

.btn-resend:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none
}

@media (max-width: 768px) {
    .success-card {
        width: 95%;
        max-height: 95vh
    }

    .success-overlay h2 {
        font-size: 24px
    }

    .success-overlay .success-icon {
        width: 86px;
        height: 86px;
        font-size: 48px
    }
}

/* Email verification */
.auth-layout--verify {
    background: linear-gradient(135deg,#ff3b3b 0%,#b30000 100%)
}

.auth-layout--verify::before {
    content: none
}

.auth-layout--verify .background-accent {
    width: 500px;
    height: 500px;
    background: rgba(255,255,255,.1);
    filter: blur(80px)
}

.auth-layout--verify .background-accent.top-right {
    top: -200px;
    right: -200px
}

.auth-layout--verify .background-accent.bottom-left {
    bottom: -200px;
    left: -200px
}

.auth-layout--verify .bg-pattern {
    opacity: .05;
    background-image: repeating-linear-gradient(45deg,transparent,transparent 35px,rgba(255,255,255,.1) 35px,rgba(255,255,255,.1) 70px)
}

.auth-layout--verify .auth-wrapper {
    display: block;
    height: auto;
    min-height: 100vh;
    padding: 20px
}

.auth-layout--verify .auth-container {
    max-width: 600px;
    margin: 0 auto;
    height: auto;
    padding: 0;
    display: block;
    background: transparent;
    box-shadow: none;
    border-left: none;
    backdrop-filter: none;
    overflow: visible
}

.verification-result-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 60px 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    text-align: center
}

.auth-layout--verify .animate-fade-in {
    animation: verifyFadeIn .5s ease forwards
}

.success-animation i {
    font-size: 100px;
    color: #28a745;
    margin-bottom: 30px;
    display: block;
    animation: verifyScaleIn .6s ease
}

.verification-failed i {
    font-size: 100px;
    color: #dc3545;
    margin-bottom: 30px;
    display: block;
    animation: shake .6s ease
}

.verification-result-card h2 {
    font-size: 36px;
    margin-bottom: 20px;
    font-weight: 700;
    color: #333333
}

.verification-result-card p {
    color: #666666;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 15px
}

.info-text {
    font-size: 16px;
    color: #888888;
    margin-top: 10px
}

.auth-layout--verify .auth-submit-button {
    display: inline-block;
    padding: 16px 48px;
    background: linear-gradient(135deg,#ff3b3b 0%,#b30000 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 8px 20px rgba(255,59,59,.3)
}

.auth-layout--verify .auth-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255,59,59,.5)
}

.auth-layout--verify .auth-submit-button:active {
    transform: translateY(0)
}

.auth-layout--verify .auth-submit-button i {
    margin-left: 8px
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    color: #ff3b3b;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all .3s ease
}

.back-link:hover {
    transform: translateX(-5px);
    color: #b30000
}

.back-link i {
    margin-right: 8px
}

@keyframes verifyFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

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

    50% {
        transform: scale(1.1)
    }

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

@keyframes shake {
    0%,100% {
        transform: translateX(0)
    }

    10%,30%,50%,70%,90% {
        transform: translateX(-10px)
    }

    20%,40%,60%,80% {
        transform: translateX(10px)
    }
}

@media (max-width: 768px) {
    .verification-result-card {
        padding: 40px 30px
    }

    .verification-result-card h2 {
        font-size: 28px
    }

    .verification-result-card p {
        font-size: 16px
    }

    .verification-success i,
    .verification-failed i {
        font-size: 80px
    }

    .auth-layout--verify .auth-submit-button {
        padding: 14px 36px;
        font-size: 15px
    }

    .auth-layout--verify .background-accent {
        width: 300px;
        height: 300px
    }
}

@media (max-width: 480px) {
    .verification-result-card {
        padding: 30px 20px
    }

    .verification-result-card h2 {
        font-size: 24px
    }

    .verification-success i,
    .verification-failed i {
        font-size: 60px
    }

    .auth-layout--verify .auth-submit-button {
        width: 100%;
        padding: 12px 24px
    }
}
