/* ====================================================================
   LOGIN — Layout específico de index.html
   Replica el diseño original (Tailwind removido).
   Carga DESPUÉS de auth.css.
   ==================================================================== */

/* ── Fuente ───────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300..700&display=swap');

/* ── Body: fondo gris, centrado ───────────────────────────────────── */
body {
    font-family: 'Quicksand', sans-serif;
    background-color: #f3f4f6;
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ── Contenedor principal ─────────────────────────────────────────── */
.login-card {
    background: white;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    border-radius: 0.5rem;
    overflow: hidden;
    max-width: 56rem;   /* max-w-4xl */
    width: 100%;
    margin: 0 1rem;
}

/* ── Grid dos columnas ────────────────────────────────────────────── */
.login-grid {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .login-grid {
        grid-template-columns: 1fr 1fr;
    }
    .login-img {
        display: block !important;
    }
}

/* ── Columna imagen ───────────────────────────────────────────────── */
.login-img {
    display: none;
}
.login-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Columna formulario ───────────────────────────────────────────── */
.login-form-col {
    padding: 2rem;
    background: linear-gradient(to top left, #fce7f3, #dbeafe);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .login-form-col {
        padding: 3rem;
    }
}

/* ── Título y subtítulo ───────────────────────────────────────────── */
.login-form-col h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}
.login-form-col .login-subtitle {
    color: #4b5563;
    margin: 0.25rem 0 0;
}

/* ── Formulario ───────────────────────────────────────────────────── */
#login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Grupos de campo ──────────────────────────────────────────────── */
.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.login-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.login-field label span {
    color: #ef4444;
}

.login-field input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
    color: #1f2937;
    background: white;
    transition: box-shadow 150ms, border-color 150ms;
    outline: none;
    box-sizing: border-box;
}

.login-field input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.3);
}

/* ── Wrapper contraseña + ojo ─────────────────────────────────────── */
.login-pw-wrap {
    position: relative;
}

.login-pw-wrap input {
    padding-right: 2.5rem;
}

#toggle-password {
    position: absolute;
    inset: 0 0 0 auto;
    padding-right: 0.75rem;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    transition: color 150ms;
}

#toggle-password:hover { color: #4b5563; }
#toggle-password:focus { outline: none; }

#toggle-password svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ── Errores de campo ─────────────────────────────────────────────── */
.login-field-error {
    color: #ef4444;
    font-size: 0.75rem;
}
.login-field-error.hidden { display: none; }

/* ── Botón submit ─────────────────────────────────────────────────── */
#submit-btn {
    width: 100%;
    background-color: #4f46e5;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 150ms;
}

#submit-btn:hover:not(:disabled) { background-color: #4338ca; }

#submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #6366f1;
}

#submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Error inline ─────────────────────────────────────────────────── */
#error-message {
    color: #b91c1c;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}
#error-message.hidden { display: none; }

/* ── Link registro ────────────────────────────────────────────────── */
.login-register-link {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}
.login-register-link a {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
}
.login-register-link a:hover { text-decoration: underline; }

/* ── Toast container ──────────────────────────────────────────────── */
#message-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    width: 91.666%;
    max-width: 24rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

/* ── Toasts ───────────────────────────────────────────────────────── */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.toast-animate { animation: slideDown 0.25s ease forwards; }

.toast {
    pointer-events: auto;
    border-left: 4px solid;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.15);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
}

.toast--success {
    background-color: #f0fdf4;
    color: #166534;
    border-color: #22c55e;
}

.toast--error {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #ef4444;
}

.toast--info {
    background-color: #eff6ff;
    color: #1e40af;
    border-color: #3b82f6;
}

/* ── Spinner ──────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}