/**
 * Recipinboard Auth Gateway & Login Required Styles
 * Premium International Culinary Design System
 * Dual Light/Dark Mode + Emerald Brand Consistency + Mobile-First Touch Ergonomics
 */

:root {
    --auth-primary-green: #064e3b;
    --auth-primary-green-hover: #043e2f;
    --auth-primary-green-active: #022c22;
    --auth-green-subtle: #ecfdf5;
    --auth-green-border: #a7f3d0;
    --auth-switch-bg: #f1f5f9;
    --auth-switch-color: #64748b;
    --auth-switch-active-bg: #064e3b;
    --auth-switch-active-color: #ffffff;
    --auth-card-border: #e2e8f0;
    --auth-card-bg: #ffffff;
    --auth-card-shadow: 0 20px 45px -15px rgba(6, 78, 59, 0.1), 0 0 1px 1px rgba(0, 0, 0, 0.04);
    --auth-input-bg: #ffffff;
    --auth-input-border: #cbd5e1;
    --auth-input-focus-border: #064e3b;
    --auth-input-focus-ring: rgba(6, 78, 59, 0.12);
    --auth-input-text: #0f172a;
    --auth-label-color: #64748b;
    --auth-social-bg: #ffffff;
    --auth-social-border: #cbd5e1;
    --auth-social-text: #1e293b;
    --auth-social-hover-bg: #f8fafc;
    --auth-social-hover-border: #94a3b8;
    --auth-divider-line: #e2e8f0;
    --auth-divider-text: #94a3b8;
}

[data-bs-theme="dark"],
[data-theme="dark"],
.dark-mode {
    --auth-primary-green: #10b981;
    --auth-primary-green-hover: #059669;
    --auth-primary-green-active: #047857;
    --auth-green-subtle: rgba(16, 185, 129, 0.12);
    --auth-green-border: rgba(16, 185, 129, 0.25);
    --auth-switch-bg: #1e293b;
    --auth-switch-color: #94a3b8;
    --auth-switch-active-bg: #10b981;
    --auth-switch-active-color: #0f172a;
    --auth-card-border: #334155;
    --auth-card-bg: #111827;
    --auth-card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --auth-input-bg: #1e293b;
    --auth-input-border: #334155;
    --auth-input-focus-border: #10b981;
    --auth-input-focus-ring: rgba(16, 185, 129, 0.22);
    --auth-input-text: #f8fafc;
    --auth-label-color: #94a3b8;
    --auth-social-bg: #1e293b;
    --auth-social-border: #334155;
    --auth-social-text: #f8fafc;
    --auth-social-hover-bg: #263346;
    --auth-social-hover-border: #475569;
    --auth-divider-line: #334155;
    --auth-divider-text: #64748b;
}

/* Base Wrapper & Card Layout */
.auth-required-wrapper,
.auth-required-card,
.auth-required-card * {
    box-sizing: border-box !important;
}

.auth-required-wrapper {
    padding: 3rem 1rem 5rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    min-width: 0 !important;
    min-height: calc(100vh - 280px);
}

.auth-required-card {
    background: var(--auth-card-bg) !important;
    border: 1px solid var(--auth-card-border) !important;
    border-radius: 1.25rem !important;
    box-shadow: var(--auth-card-shadow) !important;
    padding: 2.5rem 2.25rem !important;
    width: 100% !important;
    max-width: 480px !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    position: relative !important;
    overflow: hidden !important;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important;
}

/* Emerald Top Brand Accent Bar */
.auth-required-card::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, #064e3b 0%, #10b981 50%, #34d399 100%) !important;
    z-index: 10 !important;
}

/* Header & Icon */
.auth-header-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    padding: 0.35rem 0.85rem !important;
    border-radius: 9999px !important;
    background: var(--auth-green-subtle) !important;
    border: 1px solid var(--auth-green-border) !important;
    color: var(--auth-primary-green) !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    margin-bottom: 0.85rem !important;
}

.auth-header-title {
    font-size: 1.65rem !important;
    font-weight: 800 !important;
    color: inherit !important;
    line-height: 1.25 !important;
    margin-bottom: 0.5rem !important;
    letter-spacing: -0.02em !important;
}

.auth-header-subtitle {
    font-size: 0.9375rem !important;
    color: var(--auth-label-color) !important;
    line-height: 1.5 !important;
    margin-bottom: 1.5rem !important;
}

/* Segmented Pill Switcher */
.auth-switch-container {
    display: flex !important;
    background: var(--auth-switch-bg) !important;
    border: 1px solid var(--auth-card-border) !important;
    border-radius: 0.85rem !important;
    padding: 0.3rem !important;
    gap: 0.3rem !important;
    margin-bottom: 1.5rem !important;
}

.auth-switch-btn {
    flex: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 1rem !important;
    border-radius: 0.65rem !important;
    border: none !important;
    background: transparent !important;
    color: var(--auth-switch-color) !important;
    font-size: 0.9375rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    user-select: none !important;
}

.auth-switch-btn:hover {
    color: var(--auth-primary-green) !important;
}

.auth-switch-btn.active {
    background: var(--auth-switch-active-bg) !important;
    color: var(--auth-switch-active-color) !important;
    box-shadow: 0 4px 12px rgba(6, 78, 59, 0.2) !important;
}

[data-bs-theme="dark"] .auth-switch-btn.active,
.dark-mode .auth-switch-btn.active {
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25) !important;
}

/* Official Google Social Sign-In Button */
.auth-social-container {
    width: 100% !important;
}

.auth-social-btn,
.auth-required-card .btn-auth-social {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    border-radius: 0.75rem !important;
    background-color: var(--auth-social-bg) !important;
    border: 1.5px solid var(--auth-social-border) !important;
    color: var(--auth-social-text) !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    user-select: none !important;
}

.auth-social-btn:hover,
.auth-required-card .btn-auth-social:hover,
.auth-social-btn:focus,
.auth-required-card .btn-auth-social:focus {
    background-color: var(--auth-social-hover-bg) !important;
    border-color: var(--auth-social-hover-border) !important;
    color: var(--auth-social-text) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-1px) !important;
}

.auth-social-btn:active,
.auth-required-card .btn-auth-social:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.auth-social-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}

.auth-social-label {
    display: inline-block !important;
    line-height: 1 !important;
}

/* Elegant Context-Aware Divider */
.auth-divider {
    display: flex !important;
    align-items: center !important;
    text-align: center !important;
    margin: 1.35rem 0 1.15rem !important;
    width: 100% !important;
}

.auth-divider::before,
.auth-divider::after {
    content: '' !important;
    flex: 1 !important;
    border-bottom: 1px solid var(--auth-divider-line) !important;
}

.auth-divider-text {
    padding: 0 0.85rem !important;
    color: var(--auth-divider-text) !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    user-select: none !important;
}

/* Tab Panels */
.auth-tab-panel {
    display: none;
}

.auth-tab-panel.active {
    display: block;
    animation: authFadeIn 0.22s ease-out both;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pristine Form Inputs & Floating Labels (Eliminates Muddy Beige) */
.auth-required-card .form-floating {
    position: relative !important;
}

.auth-required-card .form-control,
.auth-required-card .auth-input {
    background-color: var(--auth-input-bg) !important;
    border: 1.5px solid var(--auth-input-border) !important;
    border-radius: 0.75rem !important;
    height: 52px !important;
    min-height: 52px !important;
    color: var(--auth-input-text) !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    padding-top: 1.35rem !important;
    padding-bottom: 0.45rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Focus State: Emerald Glow Ring */
.auth-required-card .form-control:focus,
.auth-required-card .auth-input:focus {
    background-color: var(--auth-input-bg) !important;
    border-color: var(--auth-input-focus-border) !important;
    box-shadow: 0 0 0 4px var(--auth-input-focus-ring) !important;
    outline: none !important;
}

/* Chrome / Safari Autofill Fix: Enforce crisp background instead of yellow/beige */
.auth-required-card input:-webkit-autofill,
.auth-required-card input:-webkit-autofill:hover,
.auth-required-card input:-webkit-autofill:focus,
.auth-required-card input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
    -webkit-text-fill-color: #0f172a !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

[data-bs-theme="dark"] .auth-required-card input:-webkit-autofill,
.dark-mode .auth-required-card input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px #1e293b inset !important;
    -webkit-text-fill-color: #f8fafc !important;
}

/* Floating Label Animation & Alignment */
.auth-required-card .form-floating > label {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    padding: 0.85rem 1rem !important;
    color: var(--auth-label-color) !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), color 0.18s ease, opacity 0.18s ease !important;
    pointer-events: none !important;
    transform-origin: 0 0 !important;
}

.auth-required-card .form-control:focus ~ label,
.auth-required-card .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.8) translateY(-0.7rem) translateX(0.15rem) !important;
    color: var(--auth-primary-green) !important;
    font-weight: 700 !important;
    opacity: 1 !important;
}

/* Password Wrapper & Interactive Eye Toggle */
.auth-required-card .password-wrapper {
    position: relative !important;
}

.auth-required-card .password-wrapper .form-control {
    padding-right: 48px !important;
}

.auth-required-card .auth-password-toggle {
    position: absolute !important;
    top: 50% !important;
    right: 10px !important;
    transform: translateY(-50%) !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    border: none !important;
    background: transparent !important;
    color: #94a3b8 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 5 !important;
    transition: all 0.15s ease !important;
}

.auth-required-card .auth-password-toggle:hover {
    color: var(--auth-primary-green) !important;
    background-color: var(--auth-green-subtle) !important;
}

.auth-required-card .auth-password-toggle svg {
    width: 19px !important;
    height: 19px !important;
    fill: currentColor !important;
}

.auth-required-card .auth-password-toggle .icon-eye {
    display: block !important;
}

.auth-required-card .auth-password-toggle .icon-eye-slash {
    display: none !important;
}

.auth-required-card .auth-password-toggle.show-pass .icon-eye {
    display: none !important;
}

.auth-required-card .auth-password-toggle.show-pass .icon-eye-slash {
    display: block !important;
}

/* Interactive Checkboxes: Emerald Identity (Strictly Zero Red) */
.auth-required-card .form-check {
    display: flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    min-height: 24px !important;
}

.auth-required-card .form-check-input {
    width: 18px !important;
    height: 18px !important;
    margin-top: 0 !important;
    border: 1.5px solid var(--auth-input-border) !important;
    border-radius: 5px !important;
    background-color: var(--auth-input-bg) !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
}

.auth-required-card .form-check-input:checked {
    background-color: var(--auth-primary-green) !important;
    border-color: var(--auth-primary-green) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
}

[data-bs-theme="dark"] .auth-required-card .form-check-input:checked,
.dark-mode .auth-required-card .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%230f172a' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
}

.auth-required-card .form-check-input:focus {
    box-shadow: 0 0 0 3px var(--auth-input-focus-ring) !important;
    border-color: var(--auth-primary-green) !important;
}

.auth-required-card .form-check-label {
    cursor: pointer !important;
    color: var(--auth-label-color) !important;
    user-select: none !important;
    line-height: 1.4 !important;
}

/* Links & Text: Emerald Brand Identity (Zero Red Overuse - Strict Directive) */
.auth-required-card a,
.auth-required-card .auth-link,
.auth-required-card .auth-terms-link,
.auth-required-card .auth-switch-link {
    color: var(--auth-primary-green) !important;
    text-decoration: none !important;
    transition: color 0.15s ease, text-decoration 0.15s ease !important;
}

.auth-required-card .auth-terms-link {
    font-weight: 600 !important;
    text-decoration: underline !important;
}

.auth-required-card .auth-switch-link {
    font-weight: 700 !important;
}

.auth-required-card a:hover,
.auth-required-card .auth-link:hover,
.auth-required-card .auth-terms-link:hover,
.auth-required-card .auth-switch-link:hover {
    color: var(--auth-primary-green-hover) !important;
    text-decoration: underline !important;
}

/* Forgot Password Muted Link */
.auth-required-card .auth-link-muted {
    color: var(--auth-label-color) !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: color 0.15s ease !important;
}

.auth-required-card .auth-link-muted:hover {
    color: var(--auth-primary-green) !important;
    text-decoration: underline !important;
}

.auth-required-card .auth-switch-prompt {
    color: var(--auth-label-color) !important;
}

/* Primary Action Buttons (.btn-custom) */
.auth-required-card .btn-custom {
    background-color: var(--auth-primary-green) !important;
    border-color: var(--auth-primary-green) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    height: 48px !important;
    min-height: 48px !important;
    border-radius: 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    letter-spacing: 0.01em !important;
    box-shadow: 0 4px 14px rgba(6, 78, 59, 0.25) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.auth-required-card .btn-custom:hover {
    background-color: var(--auth-primary-green-hover) !important;
    border-color: var(--auth-primary-green-hover) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 22px -3px rgba(6, 78, 59, 0.4) !important;
}

.auth-required-card .btn-custom:active {
    background-color: var(--auth-primary-green-active) !important;
    border-color: var(--auth-primary-green-active) !important;
    transform: translateY(0) !important;
    box-shadow: 0 2px 6px rgba(6, 78, 59, 0.2) !important;
}

[data-bs-theme="dark"] .auth-required-card .btn-custom,
.dark-mode .auth-required-card .btn-custom {
    background-color: var(--auth-primary-green) !important;
    border-color: var(--auth-primary-green) !important;
    color: #0f172a !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25) !important;
}

[data-bs-theme="dark"] .auth-required-card .btn-custom:hover,
.dark-mode .auth-required-card .btn-custom:hover {
    background-color: var(--auth-primary-green-hover) !important;
    border-color: var(--auth-primary-green-hover) !important;
    box-shadow: 0 8px 24px -3px rgba(16, 185, 129, 0.4) !important;
}

/* Security & Privacy Trust Footer */
.auth-trust-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.45rem !important;
    margin-top: 1.5rem !important;
    padding-top: 1.25rem !important;
    border-top: 1px dashed var(--auth-card-border) !important;
    font-size: 0.8125rem !important;
    color: #94a3b8 !important;
}

.auth-trust-footer i {
    color: var(--auth-primary-green) !important;
    font-size: 0.95rem !important;
}

/* Mobile Ergonomics (< 576px) */
@media (max-width: 575.98px) {
    .container-xl:has(.auth-required-wrapper) {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .auth-required-wrapper {
        padding: 1.25rem 0 3.5rem !important;
        width: 100% !important;
    }
    
    .auth-required-card {
        padding: 1.5rem 1rem !important;
        border-radius: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .auth-header-title {
        font-size: 1.35rem !important;
    }

    .auth-header-subtitle {
        font-size: 0.875rem !important;
        margin-bottom: 1.15rem !important;
    }
    
    .auth-switch-btn {
        height: 42px !important;
        min-height: 42px !important;
        font-size: 0.875rem !important;
        padding: 0 0.5rem !important;
        gap: 0.35rem !important;
    }
}

/* Ensure cookie consent banner does not obstruct auth gateway */
body:has(.auth-required-wrapper) #cc-wrapper,
.auth-required-wrapper ~ #cc-wrapper {
    display: none !important;
}
