/* ==========================================================================
   LOGIN PAGE - MODERN AUTHENTICATION DESIGN SYSTEM
   ========================================================================== */

/* CSS Variables for Authentication Theme */
:root {
    --auth-gradient-start: #667eea;
    --auth-gradient-end: #764ba2;
    --auth-accent: #10b981;
    --auth-danger: #ef4444;
    --auth-warning: #f59e0b;
}

/* Override main content padding for full-width hero */
.main-content {
    padding: 0 !important;
    min-height: calc(100vh - 160px);
}

/* ==========================================================================
   HERO SECTION WITH ANIMATED BACKGROUND
   ========================================================================== */

.auth-hero-section {
    min-height: calc(100vh - 160px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: var(--space-12) 0;
}

.auth-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,96C1248,75,1344,53,1392,42.7L1440,32L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: bottom;
    animation: wave 15s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ==========================================================================
   FLOATING PARTICLES BACKGROUND
   ========================================================================== */

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: float 20s infinite;
}

.particle:nth-child(1) { 
    width: 80px; 
    height: 80px; 
    left: 10%; 
    animation-delay: 0s; 
}

.particle:nth-child(2) { 
    width: 60px; 
    height: 60px; 
    left: 25%; 
    animation-delay: 2s; 
}

.particle:nth-child(3) { 
    width: 100px; 
    height: 100px; 
    left: 40%; 
    animation-delay: 4s; 
}

.particle:nth-child(4) { 
    width: 70px; 
    height: 70px; 
    left: 60%; 
    animation-delay: 6s; 
}

.particle:nth-child(5) { 
    width: 90px; 
    height: 90px; 
    left: 80%; 
    animation-delay: 8s; 
}

@keyframes float {
    0%, 100% { 
        transform: translateY(100vh) rotate(0deg); 
        opacity: 0; 
    }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% { 
        transform: translateY(-100px) rotate(360deg); 
        opacity: 0; 
    }
}

/* ==========================================================================
   CONTAINER & GLASS CARD
   ========================================================================== */

.auth-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    padding: 0 var(--space-4);
}

/* Modern Glass Morphism Card */
.auth-glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: var(--radius-2xl);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 
                0 0 100px rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    width: 100%;
    animation: cardEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ==========================================================================
   CARD HEADER
   ========================================================================== */

.auth-glass-header {
    padding: var(--space-10) var(--space-8) var(--space-8);
    text-align: center;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.auth-logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    animation: logoFloat 3s ease-in-out infinite;
    position: relative;
}

.auth-logo-icon::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
    border-radius: var(--radius-xl);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(10px);
}

.auth-logo-icon:hover::before {
    opacity: 0.6;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.auth-glass-title:not(input):not(textarea):not(select):not(button) {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--space-3);
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═════════════════════════════════════════════════════════════════════
   CRITICAL FIX: Prevent gradient text from affecting form inputs
   ═════════════════════════════════════════════════════════════════════ */
.auth-glass-title input,
.auth-glass-title textarea,
.auth-glass-title select,
.auth-glass-title button,
.auth-glass-card input,
.auth-glass-card textarea,
.auth-glass-card select,
.auth-glass-card button,
.auth-glass-body input,
.auth-glass-body textarea,
.auth-glass-body select,
.auth-glass-body button,
.form-control-auth,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    color: var(--text-primary, #1e293b) !important;
    -webkit-text-fill-color: var(--text-primary, #1e293b) !important;
    background-clip: padding-box !important;
    -webkit-background-clip: padding-box !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--secondary-400, #94a3b8) !important;
    -webkit-text-fill-color: var(--secondary-400, #94a3b8) !important;
    opacity: 0.7 !important;
}

.auth-glass-subtitle {
    color: var(--secondary-600);
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════
   CRITICAL: Protect Login Form Inputs
   ═══════════════════════════════════════════════════════ */
.auth-glass-card input,
.auth-glass-card textarea,
.auth-glass-card select,
.form-control-modern {
    color: var(--secondary-900) !important;
    -webkit-text-fill-color: var(--secondary-900) !important;
    background-clip: padding-box !important;
    -webkit-background-clip: padding-box !important;
}

/* CRITICAL: Protect all form inputs from gradient inheritance */
.auth-glass-card input,
.auth-glass-card textarea,
.auth-glass-card select,
.auth-glass-card .form-control-modern {
    color: var(--secondary-900) !important;
    -webkit-text-fill-color: var(--secondary-900) !important;
    background-clip: padding-box !important;
    -webkit-background-clip: padding-box !important;
}

/* ==========================================================================
   CARD BODY
   ========================================================================== */

.auth-glass-body {
    padding: var(--space-8);
}

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

.form-group-modern {
    margin-bottom: var(--space-6);
    position: relative;
}

.form-label-modern {
    font-weight: 600;
    color: var(--secondary-700);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-label-modern i {
    color: var(--primary-500);
    margin-right: var(--space-2);
    font-size: 1rem;
}

.form-control-modern {
    border: 2px solid var(--secondary-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    width: 100%;
    position: relative;
    font-family: inherit;
    outline: none;
    color: var(--secondary-900);
}

.form-control-modern:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.form-control-modern::placeholder {
    color: var(--secondary-400);
}

/* Input with Icon Wrapper */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    right: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-400);
    font-size: 1.125rem;
    transition: color 0.3s ease;
    cursor: pointer;
}

.input-icon-wrapper .form-control-modern {
    padding-right: calc(var(--space-10) + var(--space-4));
}

.input-icon-wrapper:focus-within .input-icon {
    color: var(--primary-500);
}

/* ==========================================================================
   ALERT SYSTEM
   ========================================================================== */

.alert-form {
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    margin-top: var(--space-3);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    animation: alertSlide 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

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

.alert-form::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.alert-form i {
    margin-right: var(--space-3);
    font-size: 1.125rem;
}

.alert-danger.alert-form {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
}

.alert-danger.alert-form::before {
    background: #ef4444;
}

.alert-warning.alert-form {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.alert-warning.alert-form::before {
    background: #f59e0b;
}

.alert-success.alert-form {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
}

.alert-success.alert-form::before {
    background: #10b981;
}

.alert-info.alert-form {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
}

.alert-info.alert-form::before {
    background: #3b82f6;
}

/* ==========================================================================
   VERIFICATION PANEL
   ========================================================================== */

.verification-panel {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 2px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-top: var(--space-5);
    margin-bottom: var(--space-5);
    position: relative;
    overflow: hidden;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
}

.verification-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

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

.verification-panel-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-4);
}

.verification-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-4);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.verification-icon i {
    color: white;
    font-size: 1.5rem;
}

.verification-panel h6 {
    color: #92400e;
    font-weight: 700;
    margin: 0;
    font-size: 1.125rem;
}

.verification-panel p {
    color: #92400e;
    margin: 0 0 var(--space-4);
    line-height: 1.6;
}

/* ==========================================================================
   BUTTON SYSTEM
   ========================================================================== */

.btn-auth {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
    cursor: pointer;
    text-decoration: none;
}

.btn-auth::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.6s;
}

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

.btn-primary-auth {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-bottom: var(--space-6);
}

.btn-primary-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-primary-auth:active {
    transform: translateY(0);
}

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

.btn-warning-auth {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    font-size: 0.9rem;
    padding: var(--space-3) var(--space-5);
}

.btn-warning-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
    color: white;
}

.btn-success-auth {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    color: white;
    text-decoration: none;
}

.btn-outline-auth {
    background: transparent;
    color: var(--secondary-700);
    border: 2px solid var(--secondary-300);
    box-shadow: none;
}

.btn-outline-auth:hover {
    background: var(--secondary-100);
    border-color: var(--secondary-400);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: var(--secondary-700);
    text-decoration: none;
}

/* ==========================================================================
   LINK STYLES
   ========================================================================== */

.auth-link-modern {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.auth-link-modern:hover {
    color: var(--primary-700);
    transform: translateX(2px);
    text-decoration: none;
}

.auth-link-modern i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.auth-link-modern:hover i {
    transform: translateX(3px);
}

/* ==========================================================================
   DIVIDER
   ========================================================================== */

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--space-8) 0;
    color: var(--secondary-500);
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--secondary-300), transparent);
}

.auth-divider:not(:empty)::before {
    margin-right: var(--space-4);
}

.auth-divider:not(:empty)::after {
    margin-left: var(--space-4);
}

/* ==========================================================================
   COLLAPSIBLE PANEL
   ========================================================================== */

.collapsible-panel {
    background: var(--secondary-50);
    border: 2px solid var(--secondary-200);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-top: var(--space-5);
}

.collapsible-panel-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-4);
}

.collapsible-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-3);
}

.collapsible-icon i {
    color: white;
    font-size: 1.125rem;
}

.collapsible-panel h6 {
    color: var(--secondary-800);
    font-weight: 700;
    margin: 0;
    font-size: 1rem;
}

.collapsible-panel p {
    color: var(--secondary-600);
    margin: 0 0 var(--space-5);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ==========================================================================
   INPUT GROUP
   ========================================================================== */

.input-group-auth {
    display: flex;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid var(--secondary-200);
    transition: all 0.3s ease;
    background: white;
}

.input-group-auth:focus-within {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.input-group-auth .input-group-text {
    background: var(--secondary-100);
    border: none;
    padding: var(--space-4);
    color: var(--secondary-600);
}

.input-group-auth .form-control {
    border: none;
    padding: var(--space-4);
    font-size: 0.9rem;
    flex: 1;
    outline: none;
}

.input-group-auth .form-control:focus {
    box-shadow: none;
    outline: none;
}

.input-group-auth .btn {
    border: none;
    border-radius: 0;
    padding: var(--space-4) var(--space-6);
    font-size: 0.9rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.input-group-auth .btn:hover {
    background: linear-gradient(135deg, #5568d3, #653b8e);
}

/* ==========================================================================
   ACTION GRID
   ========================================================================== */

.action-grid-auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-top: var(--space-5);
}

/* ==========================================================================
   HELP SECTION
   ========================================================================== */

.help-section-auth {
    text-align: center;
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--secondary-200);
}

.help-text-auth {
    color: var(--secondary-600);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.help-text-auth a {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.help-text-auth a:hover {
    color: var(--primary-700);
}

/* ==========================================================================
   TOGGLE BUTTON
   ========================================================================== */

.toggle-btn-auth {
    background: transparent;
    border: none;
    color: var(--primary-600);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: all 0.3s ease;
    font-size: 0.875rem;
    padding: var(--space-2) 0;
}

.toggle-btn-auth:hover {
    color: var(--primary-700);
    transform: translateY(-1px);
}

.toggle-btn-auth i {
    font-size: 1rem;
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.btn-loading {
    opacity: 0.7;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@media (max-width: 768px) {
    .auth-hero-section {
        padding: var(--space-8) 0;
        min-height: calc(100vh - 120px);
    }

    .auth-glass-header {
        padding: var(--space-8) var(--space-6) var(--space-6);
    }

    .auth-glass-body {
        padding: var(--space-6);
    }

    .auth-logo-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }

    .auth-glass-title {
        font-size: 1.75rem;
    }

    .action-grid-auth {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-hero-section {
        padding: var(--space-6) 0;
    }

    .auth-container {
        padding: 0 var(--space-3);
    }

    .auth-glass-card {
        border-radius: var(--radius-xl);
    }

    .auth-logo-icon {
        width: 56px;
        height: 56px;
        font-size: 1.75rem;
    }

    .auth-glass-title {
        font-size: 1.5rem;
    }

    .btn-auth {
        padding: var(--space-3) var(--space-5);
        font-size: 0.9rem;
    }
}