/* ===================================
   Village Management Portal - Login Page Styles
   ================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    line-height: 1;
    color: #08090a;
    background-color: #0e1147;
    overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(15, 40, 57, 0.75), rgba(2, 61, 37, 0.75)), var(--background-image) center/cover no-repeat;
  filter: brightness(0.8) contrast(1.1);
  filter: blur(5px);

  z-index: -1;
}

/* Main Login Wrapper */
.login-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Background Elements */
.background-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: float 20s infinite ease-in-out;
}

.floating-shape.shape-1 {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-shape.shape-2 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 15%;
    animation-delay: -7s;
}

.floating-shape.shape-3 {
    width: 60px;
    height: 60px;
    bottom: 20%;
    left: 20%;
    animation-delay: -14s;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.7;
    animation: pulse 15s infinite ease-in-out;
}

.gradient-orb.orb-1 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.gradient-orb.orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation-delay: -8s;
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    min-height: 700px;
}

/* Left Section - Branding */
.left-section {
    background: linear-gradient(249deg, #27c78c 0%, #2a3e65 100%);
    color: white;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.left-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 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.brand-header {
    position: relative;
    z-index: 2;
    margin-bottom: 40px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logo-text h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.logo-text p {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h2 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.hero-content > p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

.feature-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-content p {
    font-size: 14px;
    opacity: 0.8;
    line-height: 1.4;
}

/* Public Access */
.public-access {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.btn-public {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: rgb(255, 255, 255);
    color: rgb(0, 0, 0);
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-public:hover {
    background: rgb(138, 255, 148);
    transform: translateY(-1px);
}

.public-note {
    font-size: 12px;
    opacity: 0.8;
    line-height: 1.3;
}

/* Right Section - Login Forms */
.right-section {
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
}

.login-card {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Status Alerts */
.status-alerts {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    border: 1px solid;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fed7aa;
    color: #ea580c;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

/* Login Header */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    color: #64748b;
    font-size: 15px;
}

/* User Type Tabs */
.user-tabs {
    display: flex;
    background: #f8fafc;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 32px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover:not(.active) {
    color: #475569;
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn i {
    font-size: 16px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Styles */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 48px 14px 44px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.input-wrapper input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-wrapper input::placeholder {
    color: #9ca3af;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    font-size: 16px;
    z-index: 2;
    pointer-events: none;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.password-toggle:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

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

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.checkbox-wrapper input:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-wrapper input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 10px;
}

.forgot-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #5a67d8;
}

/* Buttons */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    width: 100%;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* Form Divider */
.form-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: #9ca3af;
    font-size: 14px;
}

.form-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
    z-index: 1;
}

.form-divider span {
    background: white;
    padding: 0 16px;
    position: relative;
    z-index: 2;
}

/* GN Info Card */
.gn-info {
    margin-top: 24px;
}

.info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.info-card i {
    color: #667eea;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.info-card p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* Mobile Public Access */
.mobile-public-access {
    display: none;
    margin-top: 24px;
    text-align: center;
}

.btn-mobile-public {
    display: inline-flex;
    align-items: center;
    width: 100%;
    gap: 8px;
    background: #f8fafc;
    color: #667eea;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.btn-mobile-public:hover {
    background: #e2e8f0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.loading-spinner p {
    font-size: 16px;
    font-weight: 500;
}

/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateY(10px) rotate(240deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.1);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .login-container {
        max-width: 900px;
        grid-template-columns: 1fr 1fr;
    }
    
    .left-section,
    .right-section {
        padding: 40px 30px;
    }
    
    .hero-content h2 {
        font-size: 28px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .login-wrapper {
        padding: 16px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .login-container {
        grid-template-columns: 1fr;
        max-width: 500px;
        min-height: auto;
    }
    
    .left-section {
        order: 2;
        padding: 40px 30px;
        text-align: center;
    }
    
    .right-section {
        order: 1;
        padding: 40px 30px;
    }
    
    .hero-content h2 {
        font-size: 24px;
        margin-bottom: 16px;
    }
    
    .hero-content > p {
        margin-bottom: 24px;
    }
    
    .features-grid {
        margin-bottom: 24px;
    }
    
    .public-access {
        justify-content: center;
        flex-direction: column;
        gap: 12px;
    }
    
    .public-note {
        max-width: none;
        text-align: center;
    }
    
    .mobile-public-access {
        display: block;
    }
    
    .public-access {
        display: none;
    }
    
    .logo-container {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        padding: 12px;
    }
    
    .left-section,
    .right-section {
        padding: 30px 20px;
    }
    
    .login-header h2 {
        font-size: 24px;
    }
    
    .user-tabs {
        margin-bottom: 24px;
    }
    
    .tab-btn {
        padding: 10px 12px;
        font-size: 13px;
        gap: 6px;
    }
    
    .input-wrapper input {
        padding: 12px 14px 12px 40px;
        font-size: 14px;
    }
    
    .input-icon {
        left: 14px;
    }
    
    .password-toggle {
        right: 14px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* Print Styles */
@media print {
    .background-elements,
    .loading-overlay {
        display: none !important;
    }
    
    .login-wrapper {
        background: white;
    }
    
    .login-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .login-container {
        border: 2px solid #000;
    }
    
    .input-wrapper input {
        border-color: #000;
    }
    
    .input-wrapper input:focus {
        border-color: #000;
        box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-shape,
    .gradient-orb {
        animation: none;
    }
}

/* Focus Styles for Accessibility */
.tab-btn:focus,
.btn-primary:focus,
.btn-secondary:focus,
.input-wrapper input:focus,
.checkbox-wrapper:focus-within,
.forgot-link:focus,
.btn-public:focus,
.btn-mobile-public:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
