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

:root {
    --verde: #2C9843;
    --azul: #5FBAE7;
    --plata: #C6C6C6;
    --blanco: #FFFFFF;
    --gris-fondo: #f4f6f8;
    --gris-texto: #444;
    --error: #e53e3e;
}

body {
    font-family: 'Inter Leve';
    background: var(--gris-fondo);
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1rem;   /* 👈 ESTO ES LA CLAVE */
}

.container {
    background: var(--blanco);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px; /* restaurado al valor original */
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    margin: 0 auto;
    margin: 2rem auto;   /* separación arriba y abajo */
}

.logo-wrap {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-wrap img {
    height: 72px;
    mix-blend-mode: multiply;
}

h1 {
    font-family: 'Glacial Indifference Negrita'!important;
    font-size: 2.2rem;
    color: var(--verde);
    text-align: center;
    margin-bottom: 0.3rem;
}

#loadingBar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: #2C9843;
    z-index: 9999;
    transition: width 0.3s ease;
}

.subtitle {
    text-align: center;
    color: var(--gris-texto);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.field {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--gris-texto);
    margin-bottom: 0.4rem;
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--plata);
    border-radius: 8px;
    font-family: 'Inter Leve';
    font-size: 1.25rem;
    color: #222;
    transition: border-color 0.2s;
    outline: none;
}

input:focus {
    border-color: var(--azul);
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 3rem;
}

.toggle-pass {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--plata);
    padding: 0;
    display: flex;
    align-items: center;
}

.toggle-pass:hover { color: var(--azul); }

.btn-primary {
    width: 100%;
    padding: 0.85rem;
    background: var(--verde);
    color: var(--blanco);
    border: none;
    border-radius: 8px;
    font-family: 'Glacial Indifference Negrita'!important;
    font-size: 1.35rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 0.5rem;
    letter-spacing: 0.03em;
}

.btn-primary:hover { background: #247a38; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { background: var(--plata); cursor: not-allowed; }

.msg {
    display: none;
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: auto;
    max-width: calc(100% - 2rem);
    padding: 0.9rem 1.25rem;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.msg.error { display: block; background: #fff5f5; color: var(--error); border: 1px solid #fed7d7; }
.msg.success { display: block; background: #f0fff4; color: var(--verde); border: 1px solid #c6f6d5; }

.links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 1.15rem;
    color: var(--gris-texto);
}

.links a {
    color: var(--azul);
    text-decoration: none;
    font-weight: 500;
}

.links a:hover { text-decoration: underline; }

.divider {
    border: none;
    border-top: 1px solid var(--plata);
    margin: 1.5rem 0;
    opacity: 0.5;
}

/* Spinner */
.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;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Language switcher */
.lang-switcher {
    position: absolute; /* no está fijo, se desplaza con la página */
    top: 0.8rem; /* queda por encima del header */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.4rem;
    background: white;
    border-radius: 20px;
    padding: 0.3rem 0.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    z-index: 1100; /* por encima del header */
}

.lang-btn {
    background: none;
    border: none;
    padding: 0.33rem 0.99rem; /* match base2 */
    border-radius: 14px;
    font-family: 'Inter Leve'; /* match base2 */
    font-size: 1.1rem; /* match base2 */
    font-weight: 600; /* match base2 */
    cursor: pointer;
    color: var(--text-light); /* use base2 variable for consistent color */
    transition: all 0.2s;
    letter-spacing: 0.05em;
}

.lang-btn.active {
    background: var(--verde);
    color: white;
}

@media (min-width: 640px) {
    .lang-switcher {
        top: 1.2rem;
    }
}
