/* Pantallas de acceso (login, registro, recuperación, Backoffice) — sección 6 */

.auth-body { background: #fff; }

.auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ---------------- Panel izquierdo ---------------- */
.auth-hero {
    position: relative;
    margin: 16px;
    height: calc(100vh - 32px);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    color: #fff;
    background: var(--color-primary);
    animation: heroIn 600ms ease-out both;
}
.auth-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--color-primary);
    animation: kenburns 20s ease-in-out infinite alternate;
}
.auth-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 110, 50, 0) 25%, rgba(0, 110, 50, .85) 68%, rgba(0, 145, 65, .95) 100%);
}
.auth-hero__content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0 40px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
}
.auth-eyebrow {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, .85);
}
.auth-hero__title {
    margin: 0;
    max-width: 14ch;
    font-size: clamp(32px, 3.4vw, 48px);
    font-weight: 500;
    line-height: 1.2;
}
.auth-hero__subtitle { margin: 0 0 12px; font-size: 18px; font-weight: 400; }
.auth-hero__subtitle .hl { color: #8FD6AE; }

.auth .auth-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 70%;
    min-width: 280px;
    min-height: 60px;
    padding: 8px 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .25);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    text-align: left;
    transition: background var(--transition);
}
.auth .auth-cta:hover { background: rgba(255, 255, 255, .35); text-decoration: none; }
.auth-cta .arrow { display: inline-flex; transition: transform var(--transition); }
.auth-cta:hover .arrow { transform: translateX(4px); }

@keyframes heroIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: scale(1); } }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.05); } }

/* ---------------- Panel derecho ---------------- */
.auth-main {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.auth-top {
    position: absolute;
    top: 0;
    right: 0;
    padding: 32px;
    font-size: 14px;
    color: var(--color-dark);
}
.auth-top[hidden], .auth-panel[hidden] { display: none; }
.auth a { color: var(--color-primary-bright); font-weight: 500; text-decoration: none; }
.auth a:hover { text-decoration: underline; }

.auth-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 96px 48px 24px;
}
.auth-form { width: 100%; max-width: 480px; }

.auth-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--color-primary);
    color: #fff;
    margin-bottom: 16px;
}
.auth-brand { margin: 0; font-size: 36px; font-weight: 600; color: var(--color-navy); line-height: 1.15; }
.auth-kicker { margin: 6px 0 0; font-size: 12px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--color-primary-bright); }
.auth-title { margin: 4px 0 48px; font-size: 36px; font-weight: 400; color: var(--color-dark); line-height: 1.2; }
.auth-lead { margin: -32px 0 32px; color: var(--gray-500); font-size: 15px; }
.auth-hint { margin: -4px 0 0; font-size: 12px; color: var(--gray-500); }

/* Campos con etiqueta interna */
.field-wrap { margin-bottom: 20px; }
.field {
    position: relative;
    height: 64px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.field label {
    display: block;
    font-size: 10px;
    line-height: 1;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--gray-400);
}
.field input {
    width: 100%;
    margin-top: 6px;
    padding: 0 36px 0 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 15px;
    color: #111827;
}
.field:focus-within { border-color: var(--color-primary-bright); box-shadow: 0 0 0 3px rgba(0, 145, 65, .12); }
.field.has-error { border-color: #DC2626; }
.field.has-error:focus-within { box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.field-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    color: var(--color-primary-bright);
    background: none;
    border: 0;
    padding: 0;
}
.field-toggle { cursor: pointer; border-radius: 4px; }
.field-error { min-height: 0; margin: 6px 0 0; font-size: 12px; color: #DC2626; }
.field-error:empty { display: none; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.remember { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--gray-500); cursor: pointer; margin-top: -4px; }
.remember input { width: 16px; height: 16px; accent-color: var(--color-primary-strong); }

.auth-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.auth-link { font-size: 14px; }

/* Botón con flecha */
.btn-go {
    position: relative;
    flex: none;
    width: 112px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: var(--color-primary-strong);
    color: #fff;
    cursor: pointer;
    transition: background var(--transition);
}
.btn-go:hover { background: #006B30; }
.btn-go__arrow { display: inline-flex; transition: transform var(--transition); }
.btn-go:hover .btn-go__arrow { transform: translateX(4px); }
.btn-go__spinner {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: spin .8s linear infinite;
}
.btn-go.is-loading .btn-go__arrow { opacity: 0; }
.btn-go.is-loading .btn-go__spinner { opacity: 1; }
.btn-go:disabled { cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-switch-mobile { display: none; margin: 24px 0 0; font-size: 14px; text-align: center; }

/* Mensajes */
.auth-alert { margin: -24px 0 24px; padding: 12px 16px; border-radius: 6px; font-size: 14px; }
.auth-alert--error { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.auth-alert--ok { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.auth-alert + .auth-alert { margin-top: -16px; }

.auth-footer { padding: 24px 48px; font-size: 13px; color: var(--gray-500); }
.auth-footer strong { color: var(--color-navy); }

/* ---------------- Animaciones de entrada ---------------- */
.rise { opacity: 0; transform: translateY(20px); animation: rise 500ms ease-out forwards; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Transición login <-> registro sin recargar */
.auth-panel.is-entering { animation: panelIn 320ms ease-out both; }
@keyframes panelIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.auth-panel.is-entering .rise { animation: none; opacity: 1; transform: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1023px) {
    .auth { grid-template-columns: 40% 60%; }
    .auth-hero__content { padding: 0 24px 40px; }
    .auth-cta { width: 100%; min-width: 0; }
    .auth-center { padding: 96px 32px 24px; }
}
@media (max-width: 767px) {
    .auth { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-center { padding: 72px 24px 24px; align-items: flex-start; }
    .auth-top { position: static; padding: 24px 24px 0; text-align: right; }
    .auth-top[data-top] { display: none; }
    .auth-switch-mobile { display: block; }
    .auth-brand, .auth-title { font-size: 30px; }
    .auth-title { margin-bottom: 32px; }
    .auth-lead { margin-top: -20px; }
    .auth-footer { padding: 16px 24px 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-hero, .auth-hero__bg, .rise, .auth-panel.is-entering { animation: none !important; opacity: 1 !important; transform: none !important; }
}

.auth-logo-img { display: block; height: 64px; width: auto; margin: 0 auto 8px; }
