/* ==============================================================
   Design System & Tokens
   ============================================================== */
:root {
    --primary-color: #0ea5e9;
    --primary-hover: #0284c7;
    --background-start: #0f172a;
    --background-end: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-family: 'Outfit', sans-serif;
    --transition-speed: 0.3s;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --success-color: #10b981;
    --error-color: #ef4444;
}

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

body {
    font-family: var(--font-family);
    /* Vibrant modern animated gradient background */
    background: linear-gradient(135deg, var(--background-start), var(--background-end));
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Decorative background elements to "WOW" the user */
body::before, body::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
    animation: drift 15s infinite alternate ease-in-out;
}

body::before {
    background: rgba(14, 165, 233, 0.2);
    top: -100px;
    left: -200px;
}

body::after {
    background: rgba(139, 92, 246, 0.2);
    bottom: -100px;
    right: -200px;
}

@keyframes drift {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(50px) scale(1.1); }
}

/* ==============================================================
   Main Layout & Glassmorphism Container
   ============================================================== */
.login-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--glass-shadow);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.glass-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px 0 rgba(0, 0, 0, 0.4);
}

/* ==============================================================
   Typography & Branding
   ============================================================== */
.brand-section {
    text-align: center;
    margin-bottom: 30px;
}

.brand-image {
    max-width: 250px;
    width: 100%;
    height: auto;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: var(--border-radius-sm);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: transform var(--transition-speed);
}

.brand-image:hover {
    transform: scale(1.03);
}

.brand-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.brand-section p {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 300;
}

/* ==============================================================
   Form Elements
   ============================================================== */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

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

.input-field i {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    font-size: 1rem;
    transition: color var(--transition-speed);
}

.input-field input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: all var(--transition-speed);
}

.input-field input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.input-field input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

/* Highlight icon when input is focused */
.input-field input:focus + i,
.input-field input:focus ~ i {
    color: var(--primary-color);
}

/* Form Actions Row (Checkbox & Forgot Password) */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    transition: color var(--transition-speed);
}
.checkbox-container:hover {
    color: var(--text-color);
}
.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    transition: all 0.2s;
}
.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

/* Forgot Password Link */
.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-speed);
}
.forgot-link:hover {
    color: #38bdf8;
    text-decoration: underline;
}

/* Buttons */
.primary-btn, .secondary-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.39);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(14, 165, 233, 0.5);
}

.secondary-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

/* Message Display */
#message {
    text-align: center;
    margin-top: 15px;
    font-weight: 600;
    font-size: 0.95rem;
    min-height: 20px; /* Preserve space */
}
.msg-success { color: var(--success-color); }
.msg-error { color: var(--error-color); }

/* ==============================================================
   Footer
   ============================================================== */
.glass-footer {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--glass-border);
    padding: 20px;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.brand-text {
    color: var(--primary-color);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-style: normal;
}

.contact-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 6px;
}

.contact-link:hover {
    color: var(--primary-color);
}

.divider {
    color: var(--glass-border);
}

/* ==============================================================
   Responsive Queries
   ============================================================== */
@media (max-width: 600px) {
    .glass-container {
        padding: 30px 20px;
    }
    
    .contact-links {
        flex-direction: column;
        gap: 8px;
    }
    
    .divider {
        display: none;
    }
}