/* 
   WORLD CLASS AUTH DESIGN - 2026 
   Aurora Mesh Gradient + Glassmorphism + Kinetic Interactions
*/

:root {
    --primary-color: #666cff;
    --primary-hover: #5a5fd7;
    --bg-color: #f4f5fa;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: 20px;
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --input-bg: rgba(255, 255, 255, 0.6);
    --input-border: rgba(0, 0, 0, 0.08);
    --input-focus-glow: 0 0 0 4px rgba(102, 108, 255, 0.15);
}

/* === 1. AURORA MESH BACKGROUND === */
body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    background-size: 200% 200%;
    animation: aurora 15s ease infinite alternate;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Light Mode Aurora Override */
body {
    background-color: #f8f9fa;
    background-image: 
        radial-gradient(at 40% 20%, rgba(102, 108, 255, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(124, 131, 255, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(200, 200, 255, 0.1) 0px, transparent 50%);
}

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

/* Floating Orbs (Optional extra depth) */
.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 10s ease-in-out infinite;
}
.auth-orb-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: rgba(102, 108, 255, 0.2);
    animation-delay: 0s;
}
.auth-orb-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(102, 108, 255, 0.15);
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 40px); }
}

/* === 2. GLASSMORPHISM CARD === */
.authentication-inner .card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow) !important;
    border-radius: 24px !important; /* More rounded */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.authentication-inner .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px 0 rgba(31, 38, 135, 0.12) !important;
}

/* === 3. MODERN INPUTS === */
.form-floating-outline .form-control {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px; /* Smooth corners */
    transition: all 0.2s ease-in-out;
}

.form-floating-outline .form-control:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: var(--input-focus-glow);
    transform: translateY(-1px);
}

.input-group-text {
    background: transparent;
    border-color: var(--input-border);
}

/* === 4. PULSING BUTTON === */
.btn-primary {
    background: linear-gradient(135deg, #666cff 0%, #5a5fd7 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 12px 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 108, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(102, 108, 255, 0.5);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Subtle pulse animation for CTA */
@keyframes pulse-soft {
    0% { box-shadow: 0 0 0 0 rgba(102, 108, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(102, 108, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 108, 255, 0); }
}

.btn-primary.pulse {
    animation: pulse-soft 2s infinite;
}

/* === 5. PREMIUM ENTRANCE ANIMATIONS (Apple/Stripe Style) === */

/* Main card - subtle scale + blur reveal */
.authentication-inner .card {
    animation: premiumCardReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes premiumCardReveal {
    0% {
        opacity: 0;
        transform: scale(0.96);
        filter: blur(8px);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/* Logo - staggered appearance */
.authentication-inner .app-brand-logo {
    opacity: 0;
    animation: premiumElementReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

/* Heading - staggered after logo */
.authentication-inner .card h5 {
    opacity: 0;
    animation: premiumElementReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}

/* Form inputs - staggered cascade */
.authentication-inner .form-floating-outline:nth-child(1) {
    opacity: 0;
    animation: premiumElementReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.30s forwards;
}

.authentication-inner .form-floating-outline:nth-child(2) {
    opacity: 0;
    animation: premiumElementReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

.authentication-inner .form-floating-outline {
    opacity: 0;
    animation: premiumElementReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

/* Remember me + Forgot password row */
.authentication-inner .form-check,
.authentication-inner .d-flex.justify-content-between {
    opacity: 0;
    animation: premiumElementReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.40s forwards;
}

/* Button */
.authentication-inner .btn-primary {
    opacity: 0;
    animation: premiumButtonReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
}

/* "Nie masz jeszcze konta?" and "Wróć do logowania" - inside card only */
.authentication-inner .card-body > .text-center,
.authentication-inner .card-body > p.text-center,
.authentication-inner .card-body form > .text-center {
    opacity: 0;
    animation: premiumElementReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.50s forwards;
}

/* Footer - appears as whole unit, no stagger on individual links */
.authentication-inner > footer {
    opacity: 0;
    animation: premiumElementReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards;
}

/* Make sure footer links don't have separate animations */
.authentication-inner > footer a {
    opacity: 1 !important;
    animation: none !important;
}

/* Element reveal - micro scale + fade */
@keyframes premiumElementReveal {
    0% {
        opacity: 0;
        transform: translateY(4px);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Button reveal - with subtle glow pulse */
@keyframes premiumButtonReveal {
    0% {
        opacity: 0;
        transform: translateY(4px) scale(0.98);
        filter: blur(4px);
    }
    70% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
    85% {
        transform: translateY(0) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* === 6. SHAKE ERROR ANIMATION === */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* === 7. LINKS & FOOTER === */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

footer {
    opacity: 0.7;
    transition: opacity 0.3s;
}

footer:hover {
    opacity: 1;
}

/* === 8. PASSWORD FIELD FIX (Double Lines & Eye Icon) === */
.form-password-toggle .input-group {
    position: relative;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* The Eye Icon Container - Floating & Transparent */
.form-password-toggle .input-group-text {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: transparent !important;
    border: none !important;
    padding: 8px;
    cursor: pointer;
    color: #9ca3af;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.form-password-toggle .input-group-text:hover {
    background-color: rgba(102, 108, 255, 0.1) !important;
    color: var(--primary-color);
}

/* The Password Input - Full Border & Padding for Icon */
.form-password-toggle .form-floating-outline .form-control {
    border-radius: 12px !important;
    border: 1px solid var(--input-border) !important;
    padding-right: 45px !important; /* Make room for the eye */
    background: var(--input-bg) !important;
    width: 100% !important;
}

.form-password-toggle .form-floating-outline .form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: var(--input-focus-glow) !important;
    background: #fff !important;
}

/* Ensure the floating wrapper doesn't clip the shadow */
.form-password-toggle .form-floating {
    width: 100%;
}

/* === 9. HIDE RECAPTCHA V3 BADGE === */
.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .authentication-inner {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    .card {
        border-radius: 16px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SWEETALERT2 - WORLD CLASS GLASSMORPHISM DESIGN
   Premium popups with behavioral psychology + Aurora aesthetic
   ═══════════════════════════════════════════════════════════════════════════ */

/* === BASE GLASS POPUP === */
.swal-glass-popup {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 24px !important;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.08),
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
    padding: 32px 28px 28px 28px !important;
    max-width: 420px !important;
    width: 90% !important;
}

/* === SUCCESS POPUP ACCENT (Purple/Blue Theme) === */
.swal-success-popup {
    border-top: 3px solid transparent !important;
    border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1 !important;
}

/* Custom icon container - no default SweetAlert icon */
.swal-custom-icon {
    border: none !important;
    margin: 0 auto 16px auto !important;
    width: auto !important;
    height: auto !important;
    background: none !important;
}

.swal-custom-icon::before,
.swal-custom-icon::after {
    display: none !important;
}

/* === ERROR POPUP ACCENT === */
.swal-error-popup {
    border-top: 3px solid transparent !important;
    border-image: linear-gradient(135deg, #ef4444 0%, #f87171 100%) 1 !important;
}

.swal-error-popup .swal2-icon.swal2-error {
    border-color: #ef4444 !important;
}

.swal-error-popup .swal2-icon.swal2-error [class^=swal2-x-mark-line] {
    background-color: #ef4444 !important;
}

/* === ANIMATED ICON === */
.swal-icon-animated {
    transform: scale(0.9);
    animation: swalIconPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.1s forwards;
}

@keyframes swalIconPop {
    0% { transform: scale(0.7); opacity: 0.5; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* === GLASS BUTTONS === */
.swal-glass-btn {
    padding: 14px 28px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.3px;
    border: none !important;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 200px;
    position: relative;
    overflow: hidden;
}

.swal-glass-btn::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.5s ease;
}

.swal-glass-btn:hover::before {
    left: 100%;
}

/* Primary Button (Purple - consistent with UI) */
.swal-glass-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #5a67d8 100%) !important;
    color: #fff !important;
    box-shadow: 
        0 4px 14px rgba(102, 126, 234, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.swal-glass-btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 
        0 8px 20px rgba(102, 126, 234, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.swal-glass-btn-primary:active {
    transform: translateY(0) scale(0.98) !important;
}

/* Success Button (Green - legacy) */
.swal-glass-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
    box-shadow: 
        0 4px 14px rgba(16, 185, 129, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.swal-glass-btn-success:hover {
    transform: translateY(-2px) !important;
    box-shadow: 
        0 8px 20px rgba(16, 185, 129, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.swal-glass-btn-success:active {
    transform: translateY(0) scale(0.98) !important;
}

/* Error Button */
.swal-glass-btn-error {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: #fff !important;
    box-shadow: 
        0 4px 14px rgba(99, 102, 241, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.swal-glass-btn-error:hover {
    transform: translateY(-2px) !important;
    box-shadow: 
        0 8px 20px rgba(99, 102, 241, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.swal-glass-btn-error:active {
    transform: translateY(0) scale(0.98) !important;
}

/* === ANIMATIONS === */

/* Show Animation */
.swal-show-animation {
    animation: swalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes swalSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Hide Animation */
.swal-hide-animation {
    animation: swalSlideOut 0.25s ease-in forwards;
}

@keyframes swalSlideOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
}

/* Shake Animation (for errors) */
.swal-shake {
    animation: swalShake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes swalShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* Celebration Pulse (for success) */
.swal-celebration-pulse {
    animation: swalCelebrate 0.6s ease-out;
}

@keyframes swalCelebrate {
    0% { 
        box-shadow: 
            0 4px 6px -1px rgba(0, 0, 0, 0.05),
            0 10px 15px -3px rgba(0, 0, 0, 0.08),
            0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% { 
        box-shadow: 
            0 4px 6px -1px rgba(0, 0, 0, 0.05),
            0 10px 15px -3px rgba(0, 0, 0, 0.08),
            0 0 0 15px rgba(16, 185, 129, 0);
    }
    100% { 
        box-shadow: 
            0 4px 6px -1px rgba(0, 0, 0, 0.05),
            0 10px 15px -3px rgba(0, 0, 0, 0.08),
            0 25px 50px -12px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
}

/* === SWAL2 GLOBAL OVERRIDES === */
.swal2-title {
    margin-top: 8px !important;
    padding: 0 !important;
}

.swal2-html-container {
    margin: 16px 0 20px 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.swal2-actions {
    margin-top: 8px !important;
}

/* Backdrop blur effect */
.swal2-container {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 480px) {
    .swal-glass-popup {
        padding: 24px 20px 20px 20px !important;
        border-radius: 20px !important;
        margin: 0 12px !important;
    }
    
    .swal-glass-btn {
        padding: 12px 24px !important;
        font-size: 0.9rem !important;
        min-width: 180px;
    }
}