/* ================== Root Colors ================== */
:root {
    --primary: #00158b;
    --primary-hover: #e17c00;
    --secondary: #000000;
    --secondary-hover: #05008a;
    --danger: #d61500;
    --success: #29c000;
    --background: #f0f4f8;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --text-dark: #222;
    --text-light: #fff;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    --radius: 1.25rem;
    --transition: all 0.3s ease;
}

/* ================== Reset ================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Roboto, sans-serif;
}

body {
    background: linear-gradient(135deg, #f89900, #032c95, #00ce26);
    background-size: 300% 300%;
    animation: gradientMove 12s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

/* Animated background */
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ================== Container ================== */
.login-container {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    color: var(--text-light);
    text-align: center;
    transition: var(--transition);
}

/* ================== Logo ================== */
.login-header {
    margin-bottom: 1.5rem;
}

.logo {
    width: 100%;
    max-width: 250px;
    min-width: 100px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
    margin-bottom: 10px;
}

/* Adjust for tablets */
@media (max-width: 768px) {
    .logo {
        max-width: 200px;
    }
}

/* Adjust for small phones */
@media (max-width: 480px) {
    .logo {
        max-width: 210px;
    }
}

/* Adjust for very tiny screens (rare, <360px) */
@media (max-width: 360px) {
    .logo {
        max-width: 220px;
    }
}

/* ================== Headings ================== */
h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-light);
}

/* ================== Errors ================== */
.errors {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.5);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 1rem;
    text-align: left;
}

.errors ul {
    list-style-type: none;
    padding-left: 0;
}

.errors li {
    font-size: 0.9rem;
    color: #ffbaba;
    margin-bottom: 0.3rem;
}

.errors li:last-child {
    margin-bottom: 0;
}

/* ================== Flash Messages ================== */
.flash-message {
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.5);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 1rem;
    color: #aed6f1;
    font-size: 0.9rem;
}

/* ================== Forms ================== */
form {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group {
    margin-bottom: 1.2rem;
    position: relative;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

label {
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-light);
    opacity: 0.9;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.2);
}

/* ================== Password Container ================== */
.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-container .form-control {
    padding-right: 40px; /* Space for the eye icon */
}

/* ================== Password Toggle ================== */
.password-toggle {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    opacity: 0.7;
    transition: var(--transition);
    font-size: 1.2rem;
}

.password-toggle:hover {
    opacity: 1;
}

/* ================== Buttons ================== */
button {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-light);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text-light);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
}

/* ================== Divider ================== */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.2rem 0;
    color: rgba(255, 255, 255, 0.7);
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.divider span {
    background: var(--glass-bg);
    padding: 0 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* ================== Google Sign-In ================== */
.google-signin-container {
    text-align: center;
    margin: 1.2rem 0;
}

.google-signin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(66, 133, 244, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    padding: 0.8rem;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    width: 100%;
}

.google-signin-button:hover {
    background: rgba(66, 133, 244, 1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.google-signin-button .google-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

/* ================== Links ================== */
.links {
    margin-top: 1rem;
    font-size: 0.9rem;
    font-weight: bold;
}

.links a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.links a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ================== Responsive ================== */
@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .form-control, button {
        font-size: 0.95rem;
        padding: 0.7rem;
    }
    
    .password-toggle {
        right: 0.8rem;
    }
}