/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-dark: #3730a3;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --background-color: #f1f5f9;
    --surface-color: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 10px;
    --radius-sm: 6px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    width: 100%;
    margin-bottom: 1rem;
}

.logo-img {
    /* Dynamic logo sizing */
    max-height: 70px;
    height: auto;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
}

/* --- General Body & Layout Styles --- */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 480px;
    padding: 30px 20px;
    box-sizing: border-box;
}

.alert-warning {
    color: #92400e;
    border: 1px solid #fde68a;
}

/* --- Login Container --- */
.login-container {
    background-color: #ffffff;
    padding: 30px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

/* --- Header --- */
h1 {
    text-align: center;
    color: #333;
    margin-top: 0;
    margin-bottom: 25px;
    font-weight: 600;
    font-size: clamp(1.5rem, 4vw, 1.8rem); /* Responsive font size */
}

/* --- Form Styles --- */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* --- Input Fields --- */
input[type="email"],
input[type="password"] {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    width: 100%;
}

/* --- Input Field Focus State --- */
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* --- Submit Button --- */
button[type="submit"] {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    margin-top: 10px;
}

/* --- Button Hover State --- */
button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(138, 43, 226, 0.3);
}

/* --- Error Message --- */
.error-message {
    color: #d93025;
    background-color: #fbe9e7;
    padding: 12px;
    border-radius: 5px;
    text-align: center;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

/* --- Signup Link at the Bottom --- */
.signup-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

.signup-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: text-decoration 0.3s ease;
}

.signup-link a:hover {
    text-decoration: underline;
}

/* --- Media Queries for Responsive Design --- */

/* Tablets and smaller desktops */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
        max-width: 90%;
    }
    
    .login-container {
        padding: 25px 20px;
    }
    
    .logo-img {
        max-height: 60px; /* Slightly smaller on tablets */
    }
    
    input[type="email"],
    input[type="password"],
    button[type="submit"] {
        padding: 14px;
        font-size: 15px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    body {
        padding: 15px;
        align-items: flex-start; /* Better for very small screens */
        min-height: 100vh;
        height: auto;
    }
    
    .container {
        padding: 15px 10px;
        max-width: 100%;
        gap: 15px;
    }
    
    .login-container {
        padding: 20px 15px;
        border-radius: 6px;
    }
    
    .logo-img {
        max-height: 50px; /* Even smaller on mobile */
    }
    
    h1 {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }
    
    input[type="email"],
    input[type="password"],
    button[type="submit"] {
        padding: 12px;
        font-size: 14px;
    }
    
    form {
        gap: 12px;
    }
}

/* Very small mobile devices */
@media (max-width: 320px) {
    .container {
        padding: 10px 5px;
    }
    
    .login-container {
        padding: 15px 10px;
    }
    
    .logo-img {
        max-height: 45px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .container {
        max-width: 450px;
    }
    
    .login-container {
        max-width: 420px;
    }
}