/**
 * easyMember Public Pages v2.0 - Premium Design System
 * WCAG 2.0 AA Compliant
 * 
 * Separate CSS file for public/external pages (before login)
 * Optimized for premium user experience and modern aesthetics
 */

/* Import CSS variables from v2.0 (reference them) */
/* Note: Variables are defined in easymember-v2.css, we reference them here */

/* ============================================
   BASE STYLES
   ============================================ */

* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body.em-public-v2-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #111827;
    background-color: #0f172a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* ============================================
   PREMIUM GRADIENT BACKGROUNDS
   ============================================ */

.bg-primary-dark-op {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    background:
        radial-gradient(1200px 700px at 14% 12%, rgba(46, 58, 99, 0.55), rgba(32, 41, 66, 0) 62%),
        radial-gradient(1000px 820px at 86% 22%, rgba(18, 27, 54, 0.50), rgba(32, 41, 66, 0) 62%),
        linear-gradient(135deg, #101523 0%, #202942 45%, #0f1424 100%);
    animation: gradientShift 20s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.bg-primary-dark-op::before {
    content: "";
    position: absolute;
    inset: -10%;
    pointer-events: none;
    background: radial-gradient(closest-side at 75% 80%, rgba(255,255,255,0.06), transparent 70%);
    mix-blend-mode: overlay;
    opacity: .35;
    animation: lightPulse 8s ease-in-out infinite;
}

.bg-primary-dark-op::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: 
        radial-gradient(circle at 20% 30%, rgba(47, 85, 212, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 60%);
    animation: particleFloat 25s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes lightPulse {
    0%, 100% {
        opacity: .35;
    }
    50% {
        opacity: .45;
    }
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
        opacity: 0.8;
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.5;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bg-primary-dark-op,
    .bg-primary-dark-op::before,
    .bg-primary-dark-op::after {
        animation: none !important;
    }
    
    .auth-card,
    .login-card,
    .reset-card,
    .two-factor-card {
        animation: none !important;
    }
    
    .hero-logo {
        animation: none !important;
    }
    
    .two-factor-icon {
        animation: none !important;
    }
    
    .outside-auth .btn-primary {
        animation: none !important;
    }
}

/* ============================================
   OUTSIDE AUTH WRAPPER
   ============================================ */

.outside-auth {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--em-spacing-lg, 1.5rem);
}

.hero-static {
    width: 100%;
    max-width: 100%;
}

.hero-variant-logo-only {
    /* Specific variant styling */
}

/* ============================================
   PREMIUM GLASSMORPHISM CARDS
   ============================================ */

.auth-card,
.login-card,
.reset-card,
.two-factor-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset,
        0 8px 32px rgba(47, 85, 212, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
    animation: cardEntrance 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-card::before,
.login-card::before,
.reset-card::before,
.two-factor-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent,
        rgba(47, 85, 212, 0.6) 20%,
        rgba(99, 102, 246, 0.8) 50%,
        rgba(47, 85, 212, 0.6) 80%,
        transparent
    );
    opacity: 0.8;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0.4;
        transform: translateX(-100%);
    }
    50% {
        opacity: 0.8;
        transform: translateX(100%);
    }
}

.auth-card::after,
.login-card::after,
.reset-card::after,
.two-factor-card::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(47, 85, 212, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.auth-card:hover::after,
.login-card:hover::after {
    opacity: 1;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .auth-card,
    .login-card,
    .reset-card,
    .two-factor-card {
        background: rgba(17, 24, 39, 0.9);
        border-color: rgba(255, 255, 255, 0.15);
        box-shadow: 
            0 25px 80px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.08) inset,
            0 8px 32px rgba(47, 85, 212, 0.15);
    }
}

/* Hover effects for interactive cards */
.login-card:hover,
.auth-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 
        0 35px 100px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.35) inset,
        0 12px 48px rgba(47, 85, 212, 0.2),
        0 0 60px rgba(99, 102, 246, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

@media (prefers-reduced-motion: reduce) {
    .auth-card,
    .login-card,
    .reset-card,
    .two-factor-card {
        transition: none !important;
    }
    
    .auth-card:hover,
    .login-card:hover {
        transform: none !important;
    }
}

/* ============================================
   HERO LOGO
   ============================================ */

.hero-logo {
    display: inline-block;
    margin-bottom: var(--em-spacing-xl, 2rem);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInDown 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.hero-logo::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(47, 85, 212, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s ease;
    pointer-events: none;
    border-radius: 50%;
    opacity: 0;
}

.hero-logo:hover::before {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.hero-logo:hover {
    transform: scale(1.05) translateY(-4px);
    filter: drop-shadow(0 12px 32px rgba(47, 85, 212, 0.4));
}

.hero-logo img {
    max-height: 128px;
    width: auto;
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
    transition: filter 0.4s ease;
    position: relative;
    z-index: 1;
}

.hero-logo:hover img {
    filter: drop-shadow(0 12px 40px rgba(47, 85, 212, 0.5));
}

@media (max-width: 480px) {
    .hero-logo img {
        max-height: 96px;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   PREMIUM FORM STYLES
   ============================================ */

.outside-auth .form-floating {
    position: relative;
    margin-bottom: 1.25rem;
}

.outside-auth .form-control {
    background-color: #F8FAFC;
    color: #111827;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 1rem 1rem 1rem 1rem;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: calc(3.5rem + 2px);
}

.outside-auth .form-control:focus {
    background-color: #FFFFFF;
    border-color: #2F55D4;
    box-shadow: 
        0 0 0 4px rgba(47, 85, 212, 0.15),
        0 8px 24px rgba(47, 85, 212, 0.2),
        0 0 40px rgba(99, 102, 246, 0.1);
    outline: none;
    transform: translateY(-2px) scale(1.01);
    border-width: 2px;
}

.outside-auth .form-control.is-invalid {
    border-color: #ef4444;
    background-color: #FEF2F2;
}

.outside-auth .form-control.is-invalid:focus {
    box-shadow: 
        0 0 0 4px rgba(239, 68, 68, 0.1),
        0 4px 12px rgba(239, 68, 68, 0.15);
}

.outside-auth .form-label {
    color: #64748b;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.outside-auth .form-floating > .form-control:focus ~ label,
.outside-auth .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: #2F55D4;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(47, 85, 212, 0.2);
}

.outside-auth .invalid-feedback {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #ef4444;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.password-toggle:hover {
    color: #2F55D4;
    background: rgba(47, 85, 212, 0.15);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(47, 85, 212, 0.3);
}

.password-toggle:focus {
    outline: 2px solid #2F55D4;
    outline-offset: 2px;
    border-radius: 4px;
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

/* Dark theme form styles */
@media (prefers-color-scheme: dark) {
    .outside-auth .form-control {
        background-color: rgba(30, 41, 59, 0.6);
        border-color: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.95);
    }
    
    .outside-auth .form-control:focus {
        background-color: rgba(30, 41, 59, 0.8);
        border-color: #2F55D4;
    }
    
    .outside-auth .form-label {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .outside-auth .form-control::placeholder {
        color: rgba(255, 255, 255, 0.4);
    }
}

/* ============================================
   PREMIUM BUTTONS
   ============================================ */

.outside-auth .btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
    position: relative;
    overflow: hidden;
}

.outside-auth .btn-primary {
    background: linear-gradient(135deg, #2F55D4 0%, #6366f1 50%, #202942 100%);
    background-size: 200% 200%;
    border: none;
    color: #ffffff;
    box-shadow: 
        0 10px 30px rgba(47, 85, 212, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    animation: gradientMove 3s ease infinite;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes gradientMove {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.outside-auth .btn-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.outside-auth .btn-primary:hover::before {
    left: 100%;
}

.outside-auth .btn-primary:hover {
    background: linear-gradient(135deg, #2544b0 0%, #4f46e5 50%, #151d33 100%);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 16px 40px rgba(47, 85, 212, 0.5),
        0 8px 16px rgba(0, 0, 0, 0.2),
        0 0 60px rgba(99, 102, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.outside-auth .btn-primary:active {
    transform: translateY(0);
    box-shadow: 
        0 4px 12px rgba(47, 85, 212, 0.35),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.outside-auth .btn-primary:focus {
    box-shadow: 
        0 0 0 4px rgba(47, 85, 212, 0.25),
        0 8px 20px rgba(47, 85, 212, 0.35);
    outline: none;
}

.outside-auth .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.outside-auth .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.outside-auth .btn-outline-primary {
    border: 2px solid #2F55D4;
    color: #2F55D4;
    background: transparent;
}

.outside-auth .btn-outline-primary:hover {
    background: linear-gradient(135deg, #2F55D4 0%, #6366f1 100%);
    color: #ffffff;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 32px rgba(47, 85, 212, 0.4),
        0 0 40px rgba(99, 102, 246, 0.2);
    border-color: transparent;
}

.outside-auth .btn-outline-secondary {
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    background: transparent;
}

.outside-auth .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.outside-auth .btn-outline-success {
    border: 2px solid #10b981;
    color: #10b981;
    background: transparent;
}

.outside-auth .btn-outline-success:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 12px 32px rgba(16, 185, 129, 0.4),
        0 0 40px rgba(16, 185, 129, 0.2);
    border-color: transparent;
}

.outside-auth .btn-dark {
    background: #1e293b;
    border: none;
    color: #ffffff;
}

.outside-auth .btn-dark:hover {
    background: #334155;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Loading state */
.outside-auth .btn .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .outside-auth .btn {
        transition: none !important;
    }
    
    .outside-auth .btn:hover,
    .outside-auth .btn:active {
        transform: none !important;
    }
}

/* ============================================
   PREMIUM ALERTS
   ============================================ */

.outside-auth .alert {
    border-radius: 16px;
    border: none;
    padding: 1.25rem 1.5rem;
    margin-bottom: var(--em-spacing-md, 1rem);
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.outside-auth .alert::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
    opacity: 0.8;
}

.outside-auth .alert-success {
    background: linear-gradient(135deg, rgba(209, 250, 229, 0.95) 0%, rgba(167, 243, 208, 0.95) 100%);
    color: #065f46;
    border-left: 4px solid #10b981;
    box-shadow: 
        0 8px 24px rgba(16, 185, 129, 0.2),
        0 0 0 1px rgba(16, 185, 129, 0.1) inset;
}

.outside-auth .alert-danger {
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.95) 0%, rgba(254, 202, 202, 0.95) 100%);
    color: #991b1b;
    border-left: 4px solid #ef4444;
    box-shadow: 
        0 8px 24px rgba(239, 68, 68, 0.2),
        0 0 0 1px rgba(239, 68, 68, 0.1) inset;
}

.outside-auth .alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.outside-auth .alert-info {
    background: linear-gradient(135deg, #e8edff 0%, #dbeafe 100%);
    color: #1e40af;
    border-left: 4px solid #2F55D4;
}

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

/* Dark theme alerts */
@media (prefers-color-scheme: dark) {
    .outside-auth .alert-success {
        background: rgba(16, 185, 129, 0.15);
        color: #6ee7b7;
    }
    
    .outside-auth .alert-danger {
        background: rgba(239, 68, 68, 0.15);
        color: #fca5a5;
    }
    
    .outside-auth .alert-warning {
        background: rgba(245, 158, 11, 0.15);
        color: #fcd34d;
    }
    
    .outside-auth .alert-info {
        background: rgba(47, 85, 212, 0.15);
        color: #93c5fd;
    }
}

/* ============================================
   TEXT STYLES
   ============================================ */

.outside-auth .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.outside-auth .auth-card .text-muted {
    color: #64748b !important;
}

@media (prefers-color-scheme: dark) {
    .outside-auth .auth-card .text-muted {
        color: rgba(255, 255, 255, 0.6) !important;
    }
}

.outside-auth h1,
.outside-auth h2,
.outside-auth h3,
.outside-auth h4,
.outside-auth h5,
.outside-auth h6 {
    color: #ffffff;
    font-weight: 700;
    margin-bottom: var(--em-spacing-md, 1rem);
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.outside-auth h1 {
    font-size: 2.5rem;
    color: #ffffff;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    animation: none !important;
}

/* Only apply gradient text to h1 outside cards, and only if not in auth-card */
.outside-auth > h1:not(.auth-card h1) {
    /* Keep simple white text, no gradient */
    color: #ffffff;
}

.outside-auth .auth-card h1,
.outside-auth .auth-card h2,
.outside-auth .auth-card h3,
.outside-auth .auth-card h4,
.outside-auth .auth-card h5,
.outside-auth .auth-card h6 {
    color: #111827;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background-clip: unset !important;
    animation: none !important;
    text-shadow: none;
}

@media (prefers-color-scheme: dark) {
    .outside-auth .auth-card h1,
    .outside-auth .auth-card h2,
    .outside-auth .auth-card h3,
    .outside-auth .auth-card h4,
    .outside-auth .auth-card h5,
    .outside-auth .auth-card h6 {
        color: rgba(255, 255, 255, 0.95);
    }
}

.outside-auth p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
}

.outside-auth .auth-card p {
    color: #374151;
    line-height: 1.7;
}

@media (prefers-color-scheme: dark) {
    .outside-auth .auth-card p {
        color: rgba(255, 255, 255, 0.85);
    }
}

.outside-auth a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s ease;
}

.outside-auth a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Forgot password link - visible and styled */
.forgot-password-link {
    color: #2F55D4 !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.forgot-password-link:hover {
    color: #2544b0 !important;
    background: rgba(47, 85, 212, 0.1);
    transform: translateY(-1px);
    text-decoration: none;
}

.forgot-password-link:focus {
    outline: 2px solid #2F55D4;
    outline-offset: 2px;
}

.forgot-password-link i {
    font-size: 0.875rem;
}

@media (prefers-color-scheme: dark) {
    .forgot-password-link {
        color: #6366f1 !important;
    }
    
    .forgot-password-link:hover {
        color: #818cf8 !important;
        background: rgba(99, 102, 246, 0.15);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

.text-white-75 {
    color: rgba(255, 255, 255, 0.75) !important;
}

.fs-sm {
    font-size: 0.875rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .outside-auth {
        padding: var(--em-spacing-md, 1rem);
    }
    
    .auth-card,
    .login-card,
    .reset-card {
        border-radius: 16px;
        padding: var(--em-spacing-lg, 1.5rem) !important;
    }
    
    .outside-auth .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .outside-auth {
        padding: var(--em-spacing-sm, 0.5rem);
    }
    
    .auth-card,
    .login-card,
    .reset-card {
        padding: var(--em-spacing-md, 1rem) !important;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus visible for keyboard navigation */
.outside-auth *:focus-visible {
    outline: 2px solid #2F55D4;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Skip link */
.visually-hidden-focusable:focus {
    position: absolute;
    z-index: 10000;
    padding: 0.5rem 1rem;
    background: #2F55D4;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
}

/* ============================================
   2FA SPECIFIC STYLES
   ============================================ */

.two-factor-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #2F55D4 0%, #6366f1 50%, #202942 100%);
    background-size: 200% 200%;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 
        0 12px 40px rgba(47, 85, 212, 0.5),
        0 0 60px rgba(99, 102, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: fadeInDown 0.8s cubic-bezier(0.4, 0, 0.2, 1), iconPulse 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.two-factor-icon::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: iconShine 4s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 12px 40px rgba(47, 85, 212, 0.5),
            0 0 60px rgba(99, 102, 246, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 
            0 16px 50px rgba(47, 85, 212, 0.6),
            0 0 80px rgba(99, 102, 246, 0.4);
    }
}

@keyframes iconShine {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) rotate(180deg);
        opacity: 0.5;
    }
}

.two-factor-icon i {
    color: #ffffff;
    font-size: 2rem;
}

.otp-input-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 2rem 0;
}

.otp-input {
    width: 56px;
    height: 64px;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    transition: all 0.2s ease;
}

.otp-input:focus {
    outline: none;
    border-color: #2F55D4;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 0 0 4px rgba(47, 85, 212, 0.3),
        0 8px 24px rgba(47, 85, 212, 0.25),
        0 0 40px rgba(99, 102, 246, 0.15);
    transform: translateY(-4px) scale(1.05);
    border-width: 3px;
    animation: inputPulse 2s ease-in-out infinite;
}

@keyframes inputPulse {
    0%, 100% {
        box-shadow: 
            0 0 0 4px rgba(47, 85, 212, 0.3),
            0 8px 24px rgba(47, 85, 212, 0.25),
            0 0 40px rgba(99, 102, 246, 0.15);
    }
    50% {
        box-shadow: 
            0 0 0 6px rgba(47, 85, 212, 0.4),
            0 12px 32px rgba(47, 85, 212, 0.35),
            0 0 60px rgba(99, 102, 246, 0.25);
    }
}

@media (prefers-color-scheme: dark) {
    .otp-input {
        background: rgba(30, 41, 59, 0.4);
        border-color: rgba(255, 255, 255, 0.15);
        color: rgba(255, 255, 255, 0.95);
    }
    .otp-input:focus {
        background: rgba(30, 41, 59, 0.6);
        border-color: #2F55D4;
    }
}

.btn-primary-2fa {
    background: linear-gradient(135deg, #2F55D4 0%, #202942 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(47, 85, 212, 0.35);
    transition: all 0.2s ease;
}

.btn-primary-2fa:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 
        0 16px 40px rgba(47, 85, 212, 0.5),
        0 0 60px rgba(99, 102, 246, 0.3);
    filter: brightness(1.1);
    color: #fff;
    background: linear-gradient(135deg, #2544b0 0%, #4f46e5 50%, #151d33 100%);
}

.btn-danger-2fa {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
    transition: all 0.2s ease;
}

.btn-danger-2fa:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 
        0 16px 40px rgba(239, 68, 68, 0.5),
        0 0 60px rgba(239, 68, 68, 0.3);
    filter: brightness(1.15);
    color: #fff;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.authenticator-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(47, 85, 212, 0.15);
    border: 2px solid rgba(47, 85, 212, 0.3);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    margin: 1rem 0;
}

.authenticator-link:hover {
    background: rgba(47, 85, 212, 0.3);
    border-color: #6366f1;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 12px 32px rgba(47, 85, 212, 0.3),
        0 0 40px rgba(99, 102, 246, 0.2);
    color: #ffffff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ============================================
   FAQ SPECIFIC STYLES
   ============================================ */

/* FAQ Category Cards */
.outside-auth .card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.outside-auth .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.outside-auth .card:hover::before {
    left: 100%;
}

.outside-auth .card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-8px) scale(1.03);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(47, 85, 212, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.outside-auth .card-title {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

/* FAQ Accordion */
.outside-auth .accordion-button {
    background: rgba(255, 255, 255, 0.08) !important;
    border: none;
    border-radius: 12px !important;
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 600;
    padding: 1rem 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.outside-auth .accordion-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.outside-auth .accordion-button:hover::before {
    left: 100%;
}

.outside-auth .accordion-button:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.outside-auth .accordion-button:not(.collapsed) {
    background: rgba(255, 255, 255, 0.12) !important;
    color: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.outside-auth .accordion-button:focus {
    box-shadow: 0 0 0 4px rgba(47, 85, 212, 0.25);
    border-color: transparent;
}

.outside-auth .accordion-body {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 0 12px 12px;
    color: rgba(255, 255, 255, 0.9);
    padding: 1.25rem;
}

.outside-auth .accordion-item {
    border: none;
    margin-bottom: 0.75rem;
}

/* ============================================
   MODAL STYLES - Modern v2.0 Design
   ============================================ */

#generalMessageModal .modal-dialog {
    max-width: 520px;
    margin: 1.25rem auto;
}

#generalMessageModal .modal-content {
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 8px 32px rgba(47, 85, 212, 0.15);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: modalEntrance 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalEntrance {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (prefers-color-scheme: dark) {
    #generalMessageModal .modal-content {
        background: rgba(17, 24, 39, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 
            0 25px 80px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.05) inset,
            0 8px 32px rgba(47, 85, 212, 0.2);
    }
}

#generalMessageModal .modal-header {
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border-bottom: none;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

#generalMessageModal .modal-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.2), transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

#generalMessageModal .modal-title {
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.25rem;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    margin: 0;
    display: flex;
    align-items: center;
    line-height: 1.2;
}

#generalMessageModal .modal-title i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

#generalMessageModal .btn-close {
    opacity: 0.9;
    filter: brightness(0) invert(1);
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0.5rem;
    align-self: center;
}

#generalMessageModal .btn-close:hover {
    opacity: 1;
    transform: scale(1.1) rotate(90deg);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Header colors for different message types */
#generalMessageModal #generalMessageModalHeader.bg-primary {
    background: linear-gradient(135deg, #2F55D4 0%, #6366f1 50%, #202942 100%);
    box-shadow: 0 4px 20px rgba(47, 85, 212, 0.3);
}

#generalMessageModal #generalMessageModalHeader.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

#generalMessageModal #generalMessageModalHeader.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

#generalMessageModal #generalMessageModalHeader.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

#generalMessageModal #generalMessageModalHeader.bg-info,
#generalMessageModal #generalMessageModalHeader.bg-info- {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
}

#generalMessageModal .modal-body {
    padding: 1.5rem;
    color: #111827;
    line-height: 1.7;
    font-size: 1rem;
}

@media (prefers-color-scheme: dark) {
    #generalMessageModal .modal-body {
        color: rgba(255, 255, 255, 0.95);
        background: rgba(17, 24, 39, 0.95);
    }
}

#generalMessageModal .modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    padding: 1rem 1.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.98);
}

@media (prefers-color-scheme: dark) {
    #generalMessageModal .modal-footer {
        border-top-color: rgba(255, 255, 255, 0.1);
        background: rgba(17, 24, 39, 0.95);
    }
}

#generalMessageModal .modal-footer .btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#generalMessageModal .modal-footer .btn-secondary {
    background: rgba(107, 114, 128, 0.1);
    border: 1px solid rgba(107, 114, 128, 0.2);
    color: #374151;
}

@media (prefers-color-scheme: dark) {
    #generalMessageModal .modal-footer .btn-secondary {
        background: rgba(107, 114, 128, 0.2);
        border-color: rgba(107, 114, 128, 0.3);
        color: rgba(255, 255, 255, 0.9);
    }
}

#generalMessageModal .modal-footer .btn-secondary:hover {
    background: rgba(107, 114, 128, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#generalMessageModal .modal-footer .btn-primary {
    background: linear-gradient(135deg, #2F55D4 0%, #6366f1 100%);
    border: none;
    color: #fff;
    box-shadow: 0 8px 20px rgba(47, 85, 212, 0.35);
}

#generalMessageModal .modal-footer .btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 28px rgba(47, 85, 212, 0.45);
    filter: brightness(1.05);
}

/* Modal backdrop */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-backdrop.show {
    opacity: 1;
}

/* Contact and Terms Modals - Modern v2.0 Design */
#modal-block-contact_us .modal-dialog,
#modal-block-payment_terms .modal-dialog {
    max-width: 600px;
    margin: 1.25rem auto;
}

#modal-block-payment_terms .modal-dialog {
    max-width: 700px;
}

#modal-block-contact_us .modal-content,
#modal-block-payment_terms .modal-content {
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 8px 32px rgba(47, 85, 212, 0.15);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: modalEntrance 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    #modal-block-contact_us .modal-content,
    #modal-block-payment_terms .modal-content {
        background: rgba(17, 24, 39, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 
            0 25px 80px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.05) inset,
            0 8px 32px rgba(47, 85, 212, 0.2);
    }
}

#modal-block-contact_us .modal-header,
#modal-block-payment_terms .modal-header {
    background: linear-gradient(135deg, #2F55D4 0%, #6366f1 50%, #202942 100%);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border-bottom: none;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    position: relative;
    overflow: hidden;
}

#modal-block-contact_us .modal-header::before,
#modal-block-payment_terms .modal-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.2), transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

#modal-block-contact_us .modal-title,
#modal-block-payment_terms .modal-title {
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.25rem;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin: 0;
    display: flex;
    align-items: center;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

#modal-block-contact_us .modal-title i,
#modal-block-payment_terms .modal-title i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

#modal-block-contact_us .btn-close,
#modal-block-payment_terms .btn-close {
    opacity: 0.9;
    filter: brightness(0) invert(1);
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0.5rem;
    align-self: center;
}

#modal-block-contact_us .btn-close:hover,
#modal-block-payment_terms .btn-close:hover {
    opacity: 1;
    transform: scale(1.1) rotate(90deg);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

#modal-block-contact_us .modal-body,
#modal-block-payment_terms .modal-body {
    padding: 1.5rem;
    color: #111827;
    line-height: 1.7;
    font-size: 0.9375rem;
    max-height: 60vh;
    overflow-y: auto;
}

@media (prefers-color-scheme: dark) {
    #modal-block-contact_us .modal-body,
    #modal-block-payment_terms .modal-body {
        color: rgba(255, 255, 255, 0.95);
        background: rgba(17, 24, 39, 0.95);
    }
}

#modal-block-contact_us .modal-body a,
#modal-block-payment_terms .modal-body a {
    color: #2F55D4;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

#modal-block-contact_us .modal-body a:hover,
#modal-block-payment_terms .modal-body a:hover {
    color: #2544b0;
    text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
    #modal-block-contact_us .modal-body a,
    #modal-block-payment_terms .modal-body a {
        color: #6366f1;
    }
    
    #modal-block-contact_us .modal-body a:hover,
    #modal-block-payment_terms .modal-body a:hover {
        color: #818cf8;
    }
}

#modal-block-contact_us .contact-info p,
#modal-block-payment_terms .terms-content p {
    margin-bottom: 1rem;
}

#modal-block-contact_us .modal-footer,
#modal-block-payment_terms .modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    padding: 1rem 1.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.98);
}

@media (prefers-color-scheme: dark) {
    #modal-block-contact_us .modal-footer,
    #modal-block-payment_terms .modal-footer {
        border-top-color: rgba(255, 255, 255, 0.1);
        background: rgba(17, 24, 39, 0.95);
    }
}

#modal-block-contact_us .modal-footer .btn,
#modal-block-payment_terms .modal-footer .btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#modal-block-contact_us .modal-footer .btn-secondary,
#modal-block-payment_terms .modal-footer .btn-secondary {
    background: rgba(107, 114, 128, 0.1);
    border: 1px solid rgba(107, 114, 128, 0.2);
    color: #374151;
}

@media (prefers-color-scheme: dark) {
    #modal-block-contact_us .modal-footer .btn-secondary,
    #modal-block-payment_terms .modal-footer .btn-secondary {
        background: rgba(107, 114, 128, 0.2);
        border-color: rgba(107, 114, 128, 0.3);
        color: rgba(255, 255, 255, 0.9);
    }
}

#modal-block-contact_us .modal-footer .btn-secondary:hover,
#modal-block-payment_terms .modal-footer .btn-secondary:hover {
    background: rgba(107, 114, 128, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============================================
   REDUCE MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

