/* ============================================================ */
/* ====== PÁGINA DE LOGIN ====== */
/* ============================================================ */

.login-body {
    background: linear-gradient(135deg, #143521 0%, #1e4a36 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    padding-top: 100px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg, 20px);
    padding: 2.5rem 2rem 2rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: loginPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes loginPopIn {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.login-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.login-titulo {
    font-family: 'Fraunces', serif;
    font-size: 1.6rem;
    color: var(--green-dark);
    margin-bottom: 0.5rem;
}

.login-subtitulo {
    color: var(--ink-soft);
    font-size: 0.92rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.login-campo {
    display: flex;
    flex-direction: column;
}

.login-input {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid var(--line);
    border-radius: var(--radius-sm, 8px);
    background: var(--surface);
    font-size: 1rem;
    font-family: inherit;
    color: var(--ink);
    transition: all 0.2s;
    letter-spacing: 0.05em;
    box-sizing: border-box;
}

.login-input::placeholder {
    color: var(--ink-soft);
    letter-spacing: normal;
}

.login-input:focus {
    outline: none;
    border-color: var(--green);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(47, 107, 79, 0.15);
}

.login-input.error {
    border-color: #d32f2f;
    background: #ffebee;
    animation: loginShake 0.4s;
}

@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

.login-error {
    display: none;
    color: #d32f2f;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    margin-top: -0.5rem;
    margin-bottom: 0.25rem;
}

.login-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm, 8px);
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 52px;
    letter-spacing: 0.03em;
}

.login-btn:hover {
    background: var(--green-dark);
}

.login-btn:active {
    transform: scale(0.98);
}

.login-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

.login-volver {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.login-volver:hover {
    color: var(--green-dark);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem 1.5rem;
    }
    .login-titulo {
        font-size: 1.35rem;
    }
    .login-icon {
        font-size: 2.5rem;
    }
    .login-subtitulo {
        font-size: 0.85rem;
    }
}

/* ============================================================ */
/* ====== AGREGADOS PARA LOGIN / REGISTRO ====== */
/* ============================================================ */

.login-campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.login-campo label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #444;
}

.login-campo label small {
    font-weight: 400;
    color: #888;
    font-size: 0.75rem;
}

.login-registro {
    text-align: center;
    margin-top: 16px;
    font-size: 0.88rem;
    color: #666;
}

.login-registro a {
    color: var(--green, #2F6B4F);
    font-weight: 600;
    text-decoration: none;
}

.login-registro a:hover {
    text-decoration: underline;
}

.login-exito {
    margin-top: 10px;
    padding: 10px 14px;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 500;
}

/* ============================================================ */
/* ====== HEADER: USUARIO LOGUEADO ====== */
/* ============================================================ */

.header-acciones {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Píldora cuando hay sesión */
.header-usuario {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 5px 5px 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
}

.header-usuario:hover {
    background: rgba(255, 255, 255, 0.18);
}

.header-usuario-nombre {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

/* Botón Salir integrado en la píldora */
.header-btn-salir {
    background: #ffffff;
    color: var(--green-dark, #1E4A36);
    border: none;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    touch-action: manipulation;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.header-btn-salir:hover {
    background: #f0f0f0;
    transform: scale(1.03);
}

.header-btn-salir:active {
    transform: scale(0.98);
}

/* Botón de ingresar (sin sesión) */
.header-btn-login {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
    touch-action: manipulation;
    white-space: nowrap;
    line-height: 1;
}

.header-btn-login:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Responsive */
@media (max-width: 600px) {
    .header-usuario {
        padding: 4px 4px 4px 10px;
        font-size: 0.8rem;
    }

    .header-usuario-nombre {
        max-width: 90px;
    }

    .header-btn-login,
    .header-btn-salir {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}