/* login.css - Focus on component styling, leveraging main.css global variables */

/* Fullscreen centering wrapper for vertical alignment */
.fullscreen-center {
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center; /* Horizontal centering */
    align-items: center;   /* Vertical centering */
    padding: 20px; /* Safety padding for small mobile screens */
    background-color: var(--background-color, #f8f9fa);
}

.login-container {
    /* Inherits font/color/background from main.css and body styles */
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    /* Ensure it doesn't touch edges on very narrow screens */
    margin: 0 auto;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    color: var(--nav-text-color, #343a40); /* Dark Charcoal heading color */
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.login-header p {
    color: var(--secondary-color, #6c757d); /* Secondary Gray text */
    font-size: 1rem;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--nav-text-color, #343a40); /* Dark Charcoal label color */
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px; /* More rounded input fields */
    font-size: 1rem;
    transition: all 0.3s ease;
    /* Prevent zoom on mobile inputs (iOS requires 16px to prevent zoom) */
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-hover-color, #E0A800); /* Darker Gold border */
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.4); /* Soft Gold focus ring */
    background-color: #fffaf0; /* Light background on focus */
}

.login-btn {
    width: 100%;
    background-color: var(--primary-color, #FFC107); /* Primary Gold button background */
    color: var(--nav-text-color, #343a40); /* Dark text on Gold */
    padding: 0.9rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn:hover {
    background-color: var(--primary-hover-color, #E0A800); /* Darker Gold hover */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.6); /* Prominent Gold shadow */
}

/* Combined link area for Forgot Password and Register links */
.auth-links-container {
    text-align: center;
    margin-top: 1.5rem;
    line-height: 1.6;
}

.auth-links-container a {
    color: var(--primary-color, #FFC107); /* Primary Gold link color */
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
}

.auth-links-container a:hover {
    text-decoration: underline;
    color: var(--primary-hover-color, #E0A800); /* Darker Gold on hover */
}

/* =========================================
   MOBILE OPTIMIZATIONS
   ========================================= */
@media (max-width: 480px) {
    /* 1. Handle Virtual Keyboard & Height Issues */
    .fullscreen-center {
        /* Switch from center to top-aligned with padding */
        /* This prevents the top of the form from being cut off when keyboard opens */
        align-items: flex-start;
        padding-top: 40px;
        padding-bottom: 40px;
        height: auto; /* Allow growing */
        min-height: 100vh;
    }

    /* 2. Container Adjustments */
    .login-container {
        padding: 1.5rem; /* Reduce padding to save space */
        box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Softer shadow */
        border: 1px solid #e9ecef; /* Add border for definition since shadow is lighter */
    }

    /* 3. Typography Scaling */
    .login-header h2 {
        font-size: 1.75rem; /* Smaller heading */
        margin-bottom: 0.25rem;
    }

    .login-header p {
        font-size: 0.9rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    /* 4. Inputs & Buttons */
    .form-group input {
        padding: 12px; /* Standardize touch target */
    }

    .login-btn {
        padding: 12px;
    }

    /* 5. Handle longer Register forms specifically */
    .login-container.register-override {
        margin-top: 0; /* Ensure it starts near the top */
    }
}