﻿/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ────────────────────────────────────────────────── */
body {
    font-family: 'Poppins', sans-serif;
    height: 100vh;
    overflow: hidden;
    background: #0d0d0d;
    font-size: 0.85rem;
    user-select: none;
}

/* ── Page layout ─────────────────────────────────────────── */
.login-page {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ── Left brand panel ────────────────────────────────────── */
.login-brand {
    flex: 1;
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 3rem;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #e30413 40%, #ff4d5a 60%, transparent);
}

.login-brand::after {
    content: '';
    position: absolute;
    bottom: -150px; right: -150px;
    width: 500px; height: 500px;
    border-radius: 50%;
    border: 70px solid rgba(227, 4, 19, 0.05);
    pointer-events: none;
}

.brand-glow {
    position: absolute;
    top: -100px; left: -100px;
    width: 350px; height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(227,4,19,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.brand-dots {
    position: absolute;
    top: 55px; left: 55px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    opacity: 0.07;
    pointer-events: none;
}
.brand-dots span {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: #fff;
    display: block;
}

.brand-line {
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, #e30413, transparent);
    margin: 1.6rem auto;
    border-radius: 2px;
}

.brand-logo {
    width: 240px;
    max-width: 75%;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 6px 32px rgba(227, 4, 19, 0.18));
}

.brand-tagline {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    text-align: center;
    position: relative;
    z-index: 1;
}

.brand-badge {
    position: absolute;
    bottom: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.55);
    font-size: 0.67rem;
    letter-spacing: 1px;
}
.brand-badge::before, .brand-badge::after {
    content: '';
    width: 20px; height: 1px;
    background: rgba(255,255,255,0.35);
}

/* ── Right form panel ────────────────────────────────────── */
.login-form-panel {
    width: 480px;
    min-width: 340px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem;
    box-shadow: -24px 0 80px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
}

.login-form-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(180deg, #e30413 0%, rgba(227,4,19,0.15) 60%, transparent 100%);
}

.login-form-panel::after {
    content: '';
    position: absolute;
    top: -120px; right: -120px;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(227,4,19,0.04) 0%, transparent 70%);
    pointer-events: none;
}

.form-header {
    width: 100%;
    margin-bottom: 2.2rem;
}

.form-header h1 {
    font-size: 1.85rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
    line-height: 1.2;
}

.form-header h1 span { color: #e30413; }

.form-header p {
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 400;
}

/* ── Form groups ─────────────────────────────────────────── */
.form-group {
    width: 100%;
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.73rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.input-wrap { position: relative; }

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #cbd5e1;
    font-size: 1rem;
    pointer-events: none;
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 300;
    transition: color 0.2s;
    line-height: 1;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 2.8rem 0.8rem 2.7rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.85rem;
    font-family: 'Poppins', sans-serif;
    color: #0f172a;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

.form-group input::placeholder {
    color: #cbd5e1;
    font-size: 0.82rem;
}

.form-group input:focus {
    border-color: #e30413;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(227, 4, 19, 0.1);
}

.input-wrap:focus-within .input-icon { color: #e30413; }

.toggle-pw {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #cbd5e1;
    font-size: 1rem;
    font-family: 'Material Symbols Outlined';
    font-variation-settings: 'FILL' 0, 'wght' 300;
    user-select: none;
    transition: color 0.2s;
    line-height: 1;
}
.toggle-pw:hover { color: #64748b; }

/* ── Login button ────────────────────────────────────────── */
.btn-login {
    width: 100%;
    padding: 0.9rem;
    background: #e30413;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    margin-top: 0.6rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 18px rgba(227, 4, 19, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: #b8030f;
    box-shadow: 0 6px 24px rgba(227, 4, 19, 0.42);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(227, 4, 19, 0.28);
}

/* ── Form footer ─────────────────────────────────────────── */
.form-footer {
    margin-top: 2.8rem;
    color: #cbd5e1;
    font-size: 0.7rem;
    text-align: center;
    letter-spacing: 0.3px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 820px) {
    .login-brand { display: none; }
    .login-form-panel {
        width: 100%;
        padding: 2.5rem 1.75rem;
        box-shadow: none;
    }
    .login-form-panel::before { display: none; }
}

/* ── Hidden utility ──────────────────────────────────────── */
.hidden { display: none; }

/* ── Message container (legacy) ──────────────────────────── */
#messageContainer {
    position: fixed !important;
    top: 10px !important; right: 10px !important;
    background-color: #4caf50;
    padding: 15px 25px !important;
    border-radius: 5px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
    z-index: 1000 !important;
    font-size: 12px !important;
    text-align: center !important;
    color: white !important;
    display: none;
}
.success { background-color: #4caf50 !important; color: white !important; }
.error   { background-color: #d9534f !important; color: white !important; }

/* ── Toast notifications ─────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 0.8rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25), 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.toast.success { background: #10b981; }
.toast.error   { background: #e30413; }
.toast.warning { background: #f59e0b; }
.toast.info    { background: #3b82f6; }

.toast-icon { width: 24px; height: 24px; flex-shrink: 0; color: white; }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; color: white; }
.toast-message { font-size: 13px; color: rgba(255,255,255,0.95); line-height: 1.4; }

.toast-close {
    background: none; border: none; color: white; cursor: pointer;
    padding: 4px; display: flex; align-items: center; justify-content: center;
    border-radius: 4px; transition: background 0.2s; opacity: 0.9;
}
.toast-close:hover { background: rgba(255,255,255,0.2); opacity: 1; }

.toast-progress {
    position: absolute; bottom: 0; left: 0;
    height: 3px; background: rgba(255,255,255,0.5);
    animation: progress 3s linear;
}

@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}
@keyframes slideOut {
    from { transform: translateX(0);     opacity: 1; }
    to   { transform: translateX(400px); opacity: 0; }
}
@keyframes progress {
    from { width: 100%; }
    to   { width: 0%;   }
}

.toast.hiding { animation: slideOut 0.3s ease-in forwards; }

/* ── Spinner en boton de login ───────────────────────────── */
.btn-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.65s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
button:disabled { opacity: 0.75; cursor: not-allowed; }
