@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

/* --- Base Reset & Body --- */
* {
    box-sizing: border-box; /* Crucial for responsive padding */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Changed from height to min-height for scrolling */
    margin: 0;
    padding: 1rem; /* Adds breathing room on small mobile screens */
}

/* --- Main Card Container --- */
.container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    /* Default for login page */
    max-width: 400px; 
    margin: 0 auto;
}

/* --- Typography --- */
h2, h3, h4 {
    color: #1f2937;
    margin-bottom: 1rem;
}

h4 {
    margin-top: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
    font-size: 1.1rem;
}

p {
    color: #6b7280;
    line-height: 1.5;
}

/* --- Forms & Inputs --- */
.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #fff;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* --- Buttons --- */
button {
    width: 100%;
    padding: 0.85rem;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 0.5rem;
}

button:hover {
    background-color: #1d4ed8;
}

.logout-btn {
    background: #ef4444;
    width: auto; /* Auto width for logout button */
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    margin-top: 0;
}
.logout-btn:hover { background: #dc2626; }

/* --- Utility Classes --- */
.toggle-link {
    margin-top: 1rem;
    display: block;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.9rem;
    text-align: center;
}

.alert {
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
}
.success { background-color: #d1fae5; color: #065f46; }
.error { background-color: #fee2e2; color: #991b1b; }

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

/* --- Radio Button Groups --- */
.radio-group label {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
    margin-bottom: 5px;
    font-weight: normal;
    cursor: pointer;
}
.radio-group input[type="radio"] {
    width: auto;
    margin-right: 6px;
}

/* --- Grid System for Dashboard --- */
.row {
    display: flex;
    gap: 1.5rem; /* Space between columns */
}

.col {
    flex: 1; /* Each column takes equal space */
}

/* =========================================
   RESPONSIVE DESIGN (Media Queries) 
   ========================================= */

/* Tablet & Mobile (Screens smaller than 768px) */
@media (max-width: 768px) {
    body {
        align-items: flex-start; /* Aligns to top so you can scroll down comfortably */
        padding: 1rem; 
    }

    .container {
        padding: 1.5rem;
        /* On login page, keep it narrow. On dashboard, let it fill screen */
        max-width: 100% !important; 
    }

    /* Stack columns vertically on mobile */
    .row {
        flex-direction: column;
        gap: 0; /* Remove gap, use margin-bottom instead */
    }

    /* Add space between stacked items */
    .col {
        margin-bottom: 0; /* Reset */
    }
    
    .col .form-group {
        margin-bottom: 1rem;
    }

    .header-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .logout-btn {
        width: 100%; /* Make logout button full width on mobile for easier tapping */
    }
    
    /* Make radio buttons stack for better readability on small screens */
    .radio-group label {
        display: flex;
        margin-bottom: 0.75rem;
        padding: 0.5rem;
        background: #f9fafb;
        border-radius: 4px;
    }
}