/* ============================================
   Auth Pages — YoPedia
   Centered Luxury 1-Side Design
   ============================================ */

/* ── Wrapper ── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    font-family: 'Outfit', 'Inter', sans-serif;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 3rem 1.25rem;
}

/* Luxury mesh gradients for premium depth */
.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    top: -150px;
    left: -150px;
    pointer-events: none;
    z-index: 0;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
    pointer-events: none;
    z-index: 0;
}

/* Floating Theme Switcher Button */
.theme-toggle-floating {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    z-index: 100;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-toggle-floating:hover {
    background: var(--accent);
    transform: scale(1.08) rotate(15deg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--muted-foreground);
}

.theme-toggle-floating:active {
    transform: scale(0.95);
}

/* ── Auth Card (Centered) ── */
.auth-card {
    width: 100%;
    max-width: 450px;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.04);
    z-index: 10;
    position: relative;
    animation: authIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-theme="dark"] .auth-card {
    background: rgba(30, 41, 59, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.06);
}

/* ── Card Brand Header ── */
.auth-card-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    text-decoration: none;
    margin-bottom: 1.75rem;
}

.auth-card-logo img {
    height: 38px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.auth-card-logo .auth-logo-mark {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.auth-card-logo .auth-logo-mark::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
}

.auth-card-logo .auth-wordmark {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--foreground);
    letter-spacing: -0.03em;
}

/* ── Auth header ── */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--foreground);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.auth-header p {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.5;
}

/* ── Alert ── */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    line-height: 1.5;
    animation: alertSlide 0.3s ease;
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert-error {
    background: var(--danger-light);
    border-color: var(--danger-border);
    color: var(--danger);
}

.auth-alert-success {
    background: var(--success-light);
    border-color: var(--success-border);
    color: var(--success);
}

/* ── Google button ── */
.auth-btn-google {
    width: 100%;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--card);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-btn-google:hover {
    background: var(--accent);
    border-color: var(--muted-foreground);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

/* ── Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin: 1.5rem 0;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Auth Form inputs ── */
.auth-form-group {
    margin-bottom: 1.25rem;
}

.auth-form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.auth-input {
    display: block;
    width: 100%;
    height: 2.75rem;
    padding: 0 0.875rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--card);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.auth-input:hover {
    border-color: var(--muted-foreground);
}

.auth-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: var(--background);
}

.auth-input::placeholder {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    opacity: 0.7;
}

[data-theme="dark"] .auth-input {
    background: var(--background);
}

[data-theme="dark"] .auth-input:focus {
    background: rgba(30, 41, 59, 0.6);
}

/* Password Toggle Eye Button */
.password-toggle-btn {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: color 0.15s ease;
}

.password-toggle-btn:hover {
    color: var(--foreground);
}

/* ── Submit button ── */
.auth-submit {
    display: flex;
    width: 100%;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    letter-spacing: 0.01em;
    margin-top: 0.75rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Forgot link ── */
.auth-forgot {
    font-size: 0.8125rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.auth-forgot:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ── Footer ── */
.auth-footer {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ── Password row ── */
.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.auth-label-row .auth-form-label {
    margin-bottom: 0;
}

/* ── 2-col form grid ── */
.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 400px) {
    .auth-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ── Agreement Checkbox & Legal Modal ── */
.auth-agreement {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin: 1.5rem 0;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    line-height: 1.5;
}

.auth-agreement input[type="checkbox"] {
    margin-top: 0.15rem;
    width: 0.95rem;
    height: 0.95rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.auth-agreement a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.auth-agreement a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Modal styling */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(8, 10, 16, 0.65);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: modalFadeIn 0.3s ease;
}

.auth-modal.active {
    display: flex;
}

.auth-modal-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 620px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.auth-modal-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-modal-title {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--foreground);
    letter-spacing: -0.01em;
}

.auth-modal-close {
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    background: var(--accent);
    color: var(--foreground);
}

.auth-modal-body {
    padding: 1.75rem;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.75;
    color: var(--foreground);
    background: var(--background);
}

.auth-modal-body h3 {
    font-size: 1.05rem;
    font-weight: 800;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--foreground);
    letter-spacing: -0.01em;
}

.auth-modal-body p {
    margin-bottom: 1.125rem;
    opacity: 0.9;
}

.auth-modal-body ul {
    margin-bottom: 1.125rem;
    padding-left: 1.5rem;
}

.auth-modal-body li {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.auth-modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    background: var(--card);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px) scale(0.96);
    }

    to {
        transform: translateY(0) scale(1);
    }
}

html, body {
    max-width: 100%;
    overflow-x: hidden !important;
}