/*
 * HomeFlow — pantallas de cuenta (login, recuperar y cambiar contraseña), según la pantalla
 * LoginScreen del design system: panel izquierdo Deep Surface con el logo reversed, el trazo del
 * techo y el tagline; formulario de 360 px sobre blanco a la derecha.
 * Se carga después de tokens.css y components.css (usa hf-field, hf-control, hf-btn, hf-check).
 */
html,
body.hf-auth-body {
    height: 100%;
}

body.hf-auth-body {
    margin: 0;
    background: var(--bg-surface);
}

.hf-auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- Panel de marca ---------- */
.hf-auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-10);
    padding: 56px;
    background: var(--brand-deep);
    color: var(--text-inverse);
}

.hf-auth-brand .hf-logo {
    position: relative;
    height: 36px;
}

/* Logo grande al centro del panel (el único: sin logo pequeño arriba) */
.hf-auth-hero {
    margin-block: auto;
    position: relative;
    display: block;
    width: 100%;
    max-width: 760px;
    height: auto;
    align-self: center;
}

/* El ícono de la marca, grande y recortado por el borde de abajo a la derecha */
.hf-auth-roof {
    position: absolute;
    right: -90px;
    bottom: -70px;
    width: 400px;
    height: auto;
    pointer-events: none;
}

.hf-auth-pitch {
    position: relative;
    max-width: 380px;
}

.hf-auth-pitch h2 {
    color: var(--text-inverse);
}

.hf-auth-pitch p {
    margin-top: var(--space-4);
    color: var(--text-inverse-muted);
}

/* ---------- Panel del formulario ---------- */
.hf-auth-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    padding: var(--space-8);
    background: var(--bg-surface);
}

.hf-auth-card {
    width: 360px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.hf-auth-card form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.hf-auth-mobile-logo {
    display: none;
    height: 32px;
    width: auto;
    align-self: flex-start;
}

.hf-auth-head p {
    margin-top: 6px;
    color: var(--text-secondary);
}

.hf-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.hf-auth-link {
    color: var(--text-link);
    font-weight: 500;
    text-decoration: none;
}

.hf-auth-link:hover {
    color: var(--action-hover);
    text-decoration: underline;
}

.hf-auth-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    align-self: center;
}

.hf-auth-foot {
    text-align: center;
    color: var(--text-muted);
}

/* Ícono de estado de las confirmaciones (correo enviado, contraseña cambiada) */
.hf-auth-status {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: grid;
    place-items: center;
    background: var(--status-info-subtle);
    color: var(--status-info);
}

.hf-auth-status.hf-tone-success {
    background: var(--status-success-subtle);
    color: var(--status-success);
}

.hf-auth-note {
    color: var(--text-secondary);
}

/* Botón "ver contraseña" dentro del control */
.hf-reveal {
    width: 32px;
    height: 32px;
    margin-right: -6px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex: none;
}

.hf-reveal:hover {
    background: var(--bg-surface-muted);
    color: var(--text-primary);
}

.hf-reveal:focus-visible {
    outline: var(--border-width-strong) solid var(--focus-ring);
    outline-offset: 0;
}

.hf-control > .hf-icon {
    color: var(--text-muted);
}

/* Validación de ASP.NET: el resumen es un hf-alert de error y los mensajes por campo, hf-error-text */
.hf-auth .validation-summary-valid,
.hf-auth .field-validation-valid {
    display: none;
}

.hf-auth .validation-summary-errors {
    padding: var(--space-4);
    border: var(--border-width) solid var(--status-error);
    border-radius: var(--radius-md);
    background: var(--status-error-subtle);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 20px;
}

.hf-auth .validation-summary-errors ul {
    margin: 0;
    padding-left: 18px;
}

.hf-auth .field-validation-error {
    font: 500 12px/16px var(--font-body);
    color: var(--status-error);
}

.hf-auth .input-validation-error {
    color: var(--text-primary);
}

.hf-field:has(.input-validation-error) .hf-control {
    border-color: var(--status-error);
}

/* ---------- Responsive: debajo de 1024 px se va el panel de marca ---------- */
@media (max-width: 1023px) {
    .hf-auth {
        grid-template-columns: minmax(0, 1fr);
    }

    .hf-auth-brand {
        display: none;
    }

    .hf-auth-mobile-logo {
        display: block;
    }
}

@media (max-width: 480px) {
    .hf-auth-panel {
        place-items: start center;
        padding: var(--space-10) var(--space-4);
    }
}
