:root {
    --primary: #dc143c;
    --primary-hover: #b01030;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #1a1a1a;
    --text-muted: #64748b;
    --input-bg: #fdfdfd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Dynamic Mesh Background */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: 
        radial-gradient(at 0% 0%, rgba(220, 20, 60, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(0, 0, 0, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(220, 20, 60, 0.08) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(0, 0, 0, 0.05) 0px, transparent 50%);
    background-size: 200% 200%;
    animation: meshFlow 20s ease-infinite;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3%3Cfilter id='noiseFilter'%3%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3%3C/filter%3%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3%3C/svg%3");
    opacity: 0.15;
    pointer-events: none;
    mix-blend-mode: multiply;
}

@keyframes meshFlow {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    z-index: 10;
    animation: fadeInScale 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.95) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 50px 40px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.05), 
        0 20px 25px -5px rgba(0, 0, 0, 0.08);
    position: relative;
    text-align: left;
}

/* Logo Area */
.logo-area {
    text-align: center;
    margin-bottom: 40px;
}

.logo-area img {
    max-width: 240px;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

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

.input-wrapper i {
    position: absolute;
    left: 20px;
    color: #475569; /* Darker Slate for icons */
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    background: var(--input-bg);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px 20px 16px 54px;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 5px rgba(220, 20, 60, 0.1);
}

input:focus + i {
    color: var(--primary);
}

/* Buttons */
.btn-login {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 18px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 15px -3px rgba(220, 20, 60, 0.3);
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(220, 20, 60, 0.4);
}

.btn-login i {
    font-size: 1.1rem;
}

/* Microsoft Button */
.btn-microsoft-wrapper {
    margin-top: 20px;
}

.btn-microsoft {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #ffffff;
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 16px;
    padding: 15px;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}

.btn-microsoft:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* Forgot Password */
.forgot-password {
    text-align: center;
    margin-top: 30px;
}

.forgot-password a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: var(--primary);
}

/* Error Messages */
.error-message {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #be123c;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Footer */
.card-footer {
    margin-top: 50px;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 25px;
}

.card-footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 480px) {
    .glass-card {
        padding: 40px 25px;
        border-radius: 20px;
    }
}

/* --- Modal System --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none; /* Controlled by JS */
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-card {
    background: #ffffff;
    width: 90%;
    max-width: 450px;
    border-radius: 24px;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    transform: translateY(20px);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-icon {
    width: 70px;
    height: 70px;
    background: rgba(220, 20, 60, 0.1);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.modal-message {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.modal-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(220, 20, 60, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}