/* Base styles for the login page inspired by absen2.html */
body {
    font-family: "Inter", sans-serif;
    margin: 0;
    padding: 0;
    /* Dark Electric / Tech Neon Background */
    background: 
        radial-gradient(ellipse at 50% 30%, rgba(191, 255, 0, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 255, 0, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(191, 255, 0, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 50%, #1a1a1a 100%);
    background-attachment: scroll;
    transition: background 0.5s ease-in-out;
    background-size: cover;
    background-position: center;

    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    position: relative;
    
    /* Prevent mobile zoom on input focus */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Animated grid pattern overlay for tech vibe */
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(191, 255, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(191, 255, 0, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    opacity: 0.4;
    animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.2;
    }
}

/* Subtle animated particles for depth */
body::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 0, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(191, 255, 0, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 0, 0.08) 1px, transparent 1px),
        radial-gradient(circle at 90% 20%, rgba(191, 255, 0, 0.08) 1px, transparent 1px);
    background-size: 200px 200px, 300px 300px, 250px 250px, 280px 280px;
    animation: particleFloat 20s linear infinite;
    z-index: 0;
    opacity: 0.6;
}

@keyframes particleFloat {
    0% {
        background-position: 0 0, 0 0, 0 0, 0 0;
    }
    100% {
        background-position: 200px 200px, -300px 300px, 250px -250px, -280px 280px;
    }
}

/* Main container */
.main-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
    margin: 0;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
}

/* Glassmorphism card style */
.card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px); /* For Safari */
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem 2.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    width: 100%;
    color: white;
}

.logo-container {
    text-align: center;
    margin-bottom: 1rem;
}

.logo-wrapper {
    position: relative;
    display: inline-block;
    width: 90px;
    height: 90px;
}

.logo-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(191, 255, 0, 0.1) 25%,
        rgba(255, 255, 0, 0.2) 50%,
        rgba(191, 255, 0, 0.1) 75%
    );
    background-size: 200% 100%;
    border-radius: 50%;
    animation: shimmer 1.5s infinite;
    z-index: 1;
    box-shadow: 
        0 0 30px rgba(191, 255, 0, 0.3),
        inset 0 0 20px rgba(191, 255, 0, 0.2);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.logo {
    width: 90px;
    /*height: 90px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);*/
    height: auto;
    position: relative;
    z-index: 2;
    opacity: 1; /* Changed from 0 to 1 - show immediately */
    transition: opacity 0.3s ease-in;
    filter: drop-shadow(0 0 10px rgba(191, 255, 0, 0.3));
}

.logo.loaded {
    opacity: 1;
    animation: logoGlow 2s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(191, 255, 0, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(191, 255, 0, 0.5));
    }
}

/* Hide placeholder when logo is loaded */
.logo-wrapper.loaded .logo-placeholder {
    display: none;
}

.card-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    /* Electric lime-green to energetic yellow gradient */
    background: linear-gradient(135deg, #bfff00 0%, #ffff00 50%, #bfff00 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    background-size: 200% 200%;
    animation: neonGradient 3s ease infinite;
    text-shadow: 
        0 0 20px rgba(191, 255, 0, 0.5),
        0 0 40px rgba(191, 255, 0, 0.3),
        0 0 60px rgba(255, 255, 0, 0.2);
    filter: drop-shadow(0 0 10px rgba(191, 255, 0, 0.4));
    letter-spacing: 0.05em;
}

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

/* Input Fields Style */
.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #e5e7eb; /* light gray */
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
}

.input-field {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.5rem; /* padding for icon */
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    box-sizing: border-box;
    color: white;
    font-size: 16px; /* Prevent iOS zoom on focus - minimum 16px required */
    transition:
        background-color 0.3s,
        border-color 0.3s;
}

.input-field:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Action Buttons with Gradient */
.action-button {
    width: 100%;
    padding: 0.85rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    transition:
        box-shadow 0.3s,
        transform 0.2s;
    margin-top: 1rem;
}

.action-button:hover {
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

/* Forgot Password Link */
.forgot-password-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: #d1d5db; /* gray-300 */
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}
.forgot-password-link:hover {
    color: white;
    text-decoration: underline;
}

/* Message Box */
.message-box {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    text-align: center;
    color: white;
}
.message-box.error {
    background-color: rgba(239, 68, 68, 0.5); /* red-500 with opacity */
}
.message-box.success {
    background-color: rgba(34, 197, 94, 0.5); /* green-500 with opacity */
}

/* --- Forgot Password Modal --- (Uses more traditional solid colors for clarity) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
}
.card-title-modal {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    color: #1e3a8a; /* dark blue */
}
.input-label-modal {
    color: #4b5563;
    font-weight: 600;
}
.input-field-modal {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-sizing: border-box;
    font-size: 16px; /* Prevent iOS zoom on focus - minimum 16px required */
}
.message-box-modal.error {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.action-button-modal {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.375rem;
    color: white;
    font-weight: 700;
    cursor: pointer;
    border: none;
}
.action-button-modal.blue {
    background-color: #3b82f6;
}
.action-button-modal.blue:hover {
    background-color: #2563eb;
}
.action-button-modal.gray {
    background-color: #6b7280;
}
.action-button-modal.gray:hover {
    background-color: #4b5563;
}

/* Utility to hide elements */
.hidden {
    display: none;
}

.card-subtitle {
    text-align: center;
    color: #d1d5db !important; /* A slightly softer white */
    font-size: 1rem;
    font-weight: 400;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    line-height: 1.4;
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #d1d5db !important;
    background-clip: unset !important;
    text-shadow: none !important;
    filter: none !important;
}

/* ===================================
   RESPONSIVE MEDIA QUERIES
   =================================== */

/* Mobile devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    body {
        background-attachment: scroll;
    }
    
    .main-container {
        padding: 0.5rem;
    }
    
    /* Reduce animation intensity on mobile for better performance */
    body::after {
        animation: particleFloat 30s linear infinite;
    }
    
    .card {
        padding: 1.5rem 1.25rem;
        border-radius: 1rem;
    }
    
    .logo-wrapper {
        width: 70px;
        height: 70px;
    }
    
    .logo {
        width: 70px;
    }
    
    .card-title {
        font-size: 1.35rem;
        margin-bottom: 1.5rem;
    }
    
    .card-subtitle {
        font-size: 0.875rem;
        margin-top: -1rem;
        margin-bottom: 1.5rem;
    }
    
    .input-group {
        margin-bottom: 1.25rem;
    }
    
    .input-label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .input-field,
    .action-button {
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        font-size: 16px; /* Crucial for preventing zoom */
    }
    
    .action-button {
        padding: 0.75rem 1rem;
        margin-top: 0.75rem;
    }
    
    .forgot-password-link {
        margin-top: 1.25rem;
        font-size: 0.9rem;
    }
    
    /* Modal adjustments for mobile */
    .modal-content {
        padding: 1.5rem;
        width: 95%;
        max-width: 350px;
    }
    
    .card-title-modal {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .input-label-modal {
        font-size: 0.9rem;
    }
    
    .input-field-modal,
    .action-button-modal {
        font-size: 16px; /* Prevent zoom */
        padding: 0.65rem;
    }
}

/* Very small devices (less than 375px - small phones) */
@media (max-width: 374.98px) {
    .main-container {
        padding: 0.25rem;
    }
    
    .card {
        padding: 1.25rem 1rem;
    }
    
    .logo-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .logo {
        width: 60px;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .card-subtitle {
        font-size: 0.8rem;
    }
    
    .input-label,
    .input-label-modal {
        font-size: 0.85rem;
    }
    
    .modal-content {
        padding: 1.25rem;
    }
}

/* Landscape orientation on mobile devices */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        align-items: flex-start;
    }
    
    .main-container {
        padding: 0.5rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .card {
        padding: 1rem 1.5rem;
        margin: 0.5rem auto;
    }
    
    .logo-wrapper {
        width: 50px;
        height: 50px;
    }
    
    .logo {
        width: 50px;
    }
    
    .card-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .card-subtitle {
        font-size: 0.8rem;
        margin-bottom: 1rem;
        margin-top: -0.75rem;
    }
    
    .input-group {
        margin-bottom: 0.75rem;
    }
    
    .input-field,
    .action-button {
        padding: 0.6rem 1rem 0.6rem 2.5rem;
    }
    
    .action-button {
        padding: 0.6rem 1rem;
        margin-top: 0.5rem;
    }
    
    .forgot-password-link {
        margin-top: 0.75rem;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
        padding: 1rem;
    }
}

/* Tablets and medium devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .main-container {
        max-width: 450px;
    }
}

/* Large tablets and desktops */
@media (min-width: 768px) {
    body {
        background-attachment: scroll;
    }
    
    /* Enhanced animations on larger screens */
    body::before {
        animation: gridPulse 3s ease-in-out infinite;
    }
    
    body::after {
        animation: particleFloat 15s linear infinite;
    }
}
