/**
 * Guest auth pages (login, register, etc.)
 * Loaded from /public — works even when Vite dev server is off and assets are not built.
 */

html.guest-auth-page {
    margin: 0;
    min-height: 100%;
}

body.guest-auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

/* Page background */
body.guest-auth-page .guest-auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(145deg, #ffe4e6 0%, #ede9fe 42%, #c7d2fe 100%);
    pointer-events: none;
}

body.guest-auth-page .guest-auth-bg-2 {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(to top, rgba(99, 102, 241, 0.22) 0%, transparent 55%, rgba(251, 113, 133, 0.12) 100%);
    pointer-events: none;
}

/* Center column: fixed max width — never full-bleed */
body.guest-auth-page .guest-auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    body.guest-auth-page .guest-auth-shell {
        padding: 3.5rem 2rem;
    }
}

body.guest-auth-page .guest-auth-max {
    width: 100%;
    max-width: 32rem; /* ~512px */
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Login card */
body.guest-auth-page .guest-login-outer {
    position: relative;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    box-sizing: border-box;
}

body.guest-auth-page .guest-login-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    border-radius: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.97);
    box-shadow:
        0 0 0 1px rgba(196, 181, 253, 0.45),
        0 25px 50px -12px rgba(49, 46, 129, 0.18);
}

@media (min-width: 640px) {
    body.guest-auth-page .guest-login-card {
        border-radius: 2.25rem;
    }
}

body.guest-auth-page .guest-login-header {
    position: relative;
    padding: 2.5rem 2rem 2.6rem;
    color: #ffffff;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    body.guest-auth-page .guest-login-header {
        padding: 3rem 2.75rem 2.75rem;
    }
}

body.guest-auth-page .guest-login-body {
    padding: 2.25rem 2rem 2.5rem;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    body.guest-auth-page .guest-login-body {
        padding: 2.5rem 2.75rem 2.75rem;
    }
}

/* Session banner */
body.guest-auth-page .guest-session-status {
    margin-bottom: 1.25rem;
    padding: 1rem 1.15rem;
    font-size: 0.875rem;
    border-radius: 1rem;
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #065f46;
    box-sizing: border-box;
}

/* Form */
body.guest-auth-page .guest-login-body form > * + * {
    margin-top: 1.5rem;
}

body.guest-auth-page .guest-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

body.guest-auth-page .guest-login-card input[type="email"],
body.guest-auth-page .guest-login-card input[type="password"],
body.guest-auth-page .guest-login-card input[type="text"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 1rem 1.2rem;
    font-size: 0.875rem;
    line-height: 1.35;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.95);
    color: #0f172a;
}

body.guest-auth-page .guest-login-card input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
}

body.guest-auth-page .guest-row-flex {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.875rem;
}

body.guest-auth-page .guest-row-flex label {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    color: #475569;
    margin: 0;
}

body.guest-auth-page .guest-login-card button[type="submit"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 1.05rem 1.25rem !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 1rem !important;
    cursor: pointer;
    background: linear-gradient(135deg, #dc2626 0%, #8b5cf6 100%) !important;
    box-shadow: 0 10px 22px -8px rgba(76, 29, 149, 0.35);
}

body.guest-auth-page .guest-login-card button[type="submit"]:hover {
    filter: brightness(1.03);
}

body.guest-auth-page .guest-login-footer-note {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
}

body.guest-auth-page .guest-login-register {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: #475569;
}

body.guest-auth-page .guest-error {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: #b91c1c;
}

/* Panel: intro text + form (forgot password, verify email, etc.) */
body.guest-auth-page .guest-auth-panel {
    width: 100%;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem 1.75rem 2.25rem;
    box-sizing: border-box;
    border-radius: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.97);
    box-shadow:
        0 0 0 1px rgba(196, 181, 253, 0.45),
        0 25px 50px -12px rgba(49, 46, 129, 0.18);
}

body.guest-auth-page .guest-auth-panel input[type="email"],
body.guest-auth-page .guest-auth-panel input[type="password"],
body.guest-auth-page .guest-auth-panel input[type="text"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 1rem 1.2rem;
    font-size: 0.875rem;
    line-height: 1.35;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.95);
    color: #0f172a;
    margin-top: 0.35rem;
}

body.guest-auth-page .guest-auth-panel input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
}

body.guest-auth-page .guest-auth-panel button[type="submit"] {
    display: inline-block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.95rem 1.25rem !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 1rem !important;
    cursor: pointer;
    background: linear-gradient(135deg, #dc2626 0%, #8b5cf6 100%) !important;
    box-shadow: 0 10px 22px -8px rgba(76, 29, 149, 0.35);
}

body.guest-auth-page .guest-auth-panel button.guest-btn-text {
    width: auto !important;
    margin-top: 0 !important;
    padding: 0.35rem 0.5rem !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
    background: transparent !important;
    box-shadow: none !important;
    text-decoration: underline;
    border-radius: 0.375rem !important;
}

/* Register: direct form under .guest-auth-max (no card wrapper) */
body.guest-auth-page .guest-auth-max > form {
    width: 100%;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem 1.75rem 2.25rem;
    box-sizing: border-box;
    border-radius: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.97);
    box-shadow:
        0 0 0 1px rgba(196, 181, 253, 0.45),
        0 25px 50px -12px rgba(49, 46, 129, 0.18);
}

body.guest-auth-page .guest-auth-max > form input[type="email"],
body.guest-auth-page .guest-auth-max > form input[type="password"],
body.guest-auth-page .guest-auth-max > form input[type="text"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 1rem 1.2rem;
    font-size: 0.875rem;
    line-height: 1.35;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.95);
    color: #0f172a;
    margin-top: 0.35rem;
}

body.guest-auth-page .guest-auth-max > form input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
}

body.guest-auth-page .guest-auth-max > form button[type="submit"] {
    display: block;
    width: 100%;
    margin-top: 1.25rem;
    padding: 1.05rem 1.25rem !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 1rem !important;
    cursor: pointer;
    background: linear-gradient(135deg, #dc2626 0%, #8b5cf6 100%) !important;
    box-shadow: 0 10px 22px -8px rgba(76, 29, 149, 0.35);
}

body.guest-auth-page .guest-auth-max > form a {
    color: #dc2626;
    font-weight: 600;
}

/* RTL: keep logical flow */
html[dir="rtl"] body.guest-auth-page .guest-login-header,
html[dir="rtl"] body.guest-auth-page .guest-login-body {
    text-align: right;
}
