/* ==========================================================================
   Variables Globales y Reset
   ========================================================================== */
:root {
    --primary-color: #1d4ed8;       /* Azul institucional */
    --primary-hover: #1e40af;
    --bg-color: #f8fafc;            /* Fondo gris claro */
    --card-bg: #ffffff;             /* Fondo de tarjetas */
    --text-color: #1e293b;          /* Texto principal */
    --text-secondary: #64748b;    /* Texto secundario */
    --border-color: #cbd5e1;        /* Bordes de inputs */
    --success-bg: #dcfce7;          /* Fondo éxito */
    --success-text: #15803d;        /* Texto éxito */
    --error-bg: #fee2e2;            /* Fondo error */
    --error-text: #b91c1c;          /* Texto error */
    --radius: 8px;                  /* Bordes redondeados */
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* ==========================================================================
   Contenedor Principal
   ========================================================================== */
.container {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 480px;
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #e2e8f0;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 24px;
}

/* ==========================================================================
   Formularios e Inputs
   ========================================================================== */
label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 16px;
    color: var(--text-color);
}

label:first-of-type {
    margin-top: 0;
}

input[type="password"],
select {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: #fff;
    color: var(--text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

input[type="password"]:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2);
}

select:disabled,
input:disabled {
    background-color: #f1f5f9;
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* ==========================================================================
   Botones
   ========================================================================== */
button {
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--primary-color);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

button:hover {
    background-color: var(--primary-hover);
}

button:active {
    transform: scale(0.99);
}

button:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Mensajes de Éxito / Error
   ========================================================================== */
#mensaje {
    margin-top: 20px;
}

.exito {
    background-color: var(--success-bg);
    color: var(--success-text);
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid #bbf7d0;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.error {
    background-color: var(--error-bg);
    color: var(--error-text);
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid #fecaca;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* ==========================================================================
   Adaptabilidad Móvil
   ========================================================================== */
@media (max-width: 480px) {
    .container {
        padding: 20px;
    }

    h2 {
        font-size: 1.25rem;
    }
}