/* Modern Orange Dot Theme CSS */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    overflow-x: hidden;
    height: 100vh;
    background: #0a0a0a;
    color: #fff;
}

/* Static Dotted Background */
.dotted-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    background-color: #0a0a0a;
    background-image: 
        radial-gradient(circle at 1px 1px, #cc0000 2px, transparent 0);
    background-size: 40px 40px;
    opacity: 0.4;
}

/* Main Container */
.main-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Logo Card (Initial State) */
.logo-card {
    background: linear-gradient(145deg, #1a1a1e 0%, #141416 40%, #121214 60%, #1a1a1e 100%);
    backdrop-filter: blur(30px);
    border: 2px solid rgba(204, 0, 0, 0.4);
    border-radius: 24px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(204, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    text-align: center;
    /* Make card fit logo size */
    width: fit-content;
    height: fit-content;
}

.logo-card:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: rgba(204, 0, 0, 0.6);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(204, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.logo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(204, 0, 0, 0.1),
        transparent
    );
    transition: left 0.6s;
}

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

/* Magical morph shimmer when animating */
.logo-card.morphing::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(120px 60px at 20% 10%, rgba(230, 80, 80, 0.20), transparent 60%),
                radial-gradient(140px 70px at 80% 90%, rgba(220, 50, 50, 0.18), transparent 60%),
                linear-gradient(45deg, rgba(204,0,0,0.15), transparent 60%);
    filter: blur(10px);
    opacity: 0;
    animation: morph-shimmer 1.15s ease forwards;
}

@keyframes morph-shimmer {
    0% { opacity: 0; transform: scale(0.98); }
    40% { opacity: 1; transform: scale(1.00); }
    100% { opacity: 0.35; transform: scale(1.02); }
}

.logo-image {
    max-width: 280px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(204, 0, 0, 0.3));
    transition: all 0.4s ease;
    display: block;
}

.logo-card:hover .logo-image {
    filter: drop-shadow(0 0 30px rgba(204, 0, 0, 0.5));
    transform: scale(1.02);
}

/* Login Card (Expanded State) */
.login-card {
    /* Dark card matching site theme */
    background: linear-gradient(145deg, #1a1a1e 0%, #141416 40%, #121214 60%, #1a1a1e 100%);
    backdrop-filter: blur(30px);
    border: 2px solid rgba(204, 0, 0, 0.4);
    border-radius: 28px;
    padding: 2rem;
    width: 420px;
    box-shadow: 
        0 30px 100px rgba(0, 0, 0, 0.7),
        0 0 80px rgba(204, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0);
    opacity: 0;
    /* Initial position same as logo card */
    transform-origin: center center;
}

/* Removed shared ::after overlay to avoid conflicts with shimmer; base backgrounds now match via gradient */

.hidden {
    display: none !important;
}

/* Login Content */
.login-content {
    position: relative;
    z-index: 2;
}

/* Login Logo */
.login-logo {
    text-align: center;
    margin-bottom: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-logo-image {
    max-width: 280px;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(204, 0, 0, 0.3));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-logo:hover .login-logo-image {
    filter: drop-shadow(0 0 25px rgba(204, 0, 0, 0.5));
    transform: scale(1.03);
}

/* Login Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Input Groups */
.input-group {
    position: relative;
    margin-bottom: 0.5rem;
}

/* Enhanced specificity for inputs */
.login-card .modern-input,
.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100% !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 2px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 30px !important;
    color: #fff !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    padding: 1rem 1.25rem !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}

.modern-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 30px !important;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    padding: 1rem 1.25rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    backdrop-filter: none;
    box-shadow: none;
}

.modern-input::placeholder {
    color: transparent;
}

.modern-input:focus {
    border-color: #cc0000;
    background: rgba(204, 0, 0, 0.08);
    box-shadow: 
        0 0 0 4px rgba(204, 0, 0, 0.15),
        0 4px 16px rgba(204, 0, 0, 0.08);
    transform: translateY(-3px) scale(1.02);
}

.modern-input:hover:not(:focus) {
    border-color: rgba(204, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.input-label {
    position: absolute;
    top: 50%;
    left: 1.25rem;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    font-weight: 500;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    z-index: 1;
}

.input-group.focused .input-label,
.input-group.has-value .input-label {
    top: 0;
    left: 1.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #ff4444;
    background: #141416;
    padding: 0 0.35rem;
    transform: translateY(-50%);
    line-height: 1;
    border-radius: 0;
    backdrop-filter: none;
    box-shadow: none;
    z-index: 2;
}

/* Error Message */
.error-message {
    background: rgba(220, 38, 38, 0.1);
    border: 2px solid rgba(220, 38, 38, 0.3);
    border-radius: 18px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
    overflow: hidden;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
    max-height: 100px;
    padding: 0.8rem 1rem;
    margin: 0.5rem 0;
}

.error-icon {
    color: #dc2626;
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
}

.error-text {
    color: #fca5a5;
    font-size: 0.9rem;
    font-weight: 500;
}

/* CAPTCHA Container */
.captcha-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.5rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 22px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.captcha-container:hover {
    border-color: rgba(204, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

#myWidget {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 65px;
}

#myWidget > div,
#myWidget iframe {
    border-radius: 18px !important;
    max-width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

/* Modern Login Button */
.modern-login-btn,
.login-card button[type="submit"],
.login-card .btn {
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%) !important;
    border: none !important;
    border-radius: 30px !important;
    color: #fff !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    padding: 1rem 2rem !important;
    width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    cursor: pointer !important;
    margin-top: 0.5rem !important;
    box-shadow: 
        0 8px 32px rgba(204, 0, 0, 0.3),
        0 0 0 0 rgba(204, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px) !important;
}

.modern-login-btn {
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    border: none;
    border-radius: 30px !important;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1rem 2rem;
    width: 100%;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 0.5rem;
    box-shadow: 
        0 8px 32px rgba(204, 0, 0, 0.3),
        0 0 0 0 rgba(204, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.modern-login-btn:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 16px 40px rgba(204, 0, 0, 0.4),
        0 0 0 4px rgba(204, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #990000 0%, #cc0000 100%);
}

.modern-login-btn:active:not(:disabled) {
    transform: translateY(-2px) scale(1.01);
}

.modern-login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 
        0 4px 16px rgba(204, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-ripple {
    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;
}

.modern-login-btn:hover .btn-ripple {
    left: 100%;
}

/* Loading Animation */
.lds-ring {
    display: inline-block;
    position: relative;
    width: 40px;
    height: 40px;
    margin: 0 auto 1.5rem;
}

.lds-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 32px;
    height: 32px;
    margin: 4px;
    border: 4px solid #cc0000;
    border-radius: 50%;
    animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #cc0000 transparent transparent transparent;
}

.lds-ring div:nth-child(1) { animation-delay: -0.45s; }
.lds-ring div:nth-child(2) { animation-delay: -0.3s; }
.lds-ring div:nth-child(3) { animation-delay: -0.15s; }

@keyframes lds-ring {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-card {
        padding: 2rem;
    }
    
    .login-card {
        width: 420px; /* Keep standard size */
        padding: 2rem;
        margin: 1rem;
    }
    
    .logo-image {
        max-width: 180px; /* Keep consistent with desktop */
    }
    
    .login-logo-image {
        max-width: 180px; /* Keep consistent with desktop */
    }
    
    .main-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .dotted-background {
        background-size: 30px 30px;
    }
    
    .logo-card {
        padding: 1.5rem;
    }
    
    .login-card {
        width: 360px; /* Smaller but consistent on mobile */
        padding: 1.5rem;
    }
    
    .logo-image {
        max-width: 180px; /* Keep consistent */
    }
    
    .login-logo-image {
        max-width: 180px; /* Keep consistent */
    }
    
    .modern-input {
        font-size: 0.9rem;
        padding: 0.9rem 1rem;
    }
    
    .modern-login-btn {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }
}

/* Accessibility */
.modern-input:focus,
.modern-login-btn:focus {
    outline: 3px solid rgba(204, 0, 0, 0.6);
    outline-offset: 2px;
}

/* Smooth Animations */
.login-card,
.logo-card {
    will-change: transform, opacity;
}

/* Contact Email */
.contact-email {
    text-align: center;
    margin-top: 1.2rem;
}

.contact-email a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    letter-spacing: 0.3px;
}

.contact-email a:hover {
    color: #ff4444;
}

.contact-email .fa-envelope {
    margin-right: 6px;
    font-size: 0.85rem;
}

/* Copyright */
.copyright-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    letter-spacing: 0.3px;
    margin-top: 1rem;
    padding-bottom: 0.5rem;
    transition: opacity 0.4s ease;
}

.copyright-text.fixed-bottom {
    position: fixed;
    bottom: auto;
    left: 0;
    right: 0;
    margin-top: 0;
    top: calc(50% + 340px);
}

/* Enhanced Visual Effects */
.login-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #cc0000, transparent, #cc0000);
    border-radius: 34px;
    z-index: -1;
    opacity: 0.3;
    animation: glow-border 4s ease-in-out infinite alternate;
}

@keyframes glow-border {
    0% { opacity: 0.3; }
    100% { opacity: 0.6; }
}