/* ============================================================
   auth.css — Login, Register, Forgot & Reset password
   Summus Aeterni
   ============================================================ */

/* ── Accesibilidad: visualmente oculto pero legible por lectores ── */
.sa-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ══════════════════════════════════════════════════════════════
   BODY — quitar el padding-top del nav fijo (navbar.css pone
   padding-top: var(--navbar-height) a todo el body)
   ══════════════════════════════════════════════════════════════ */
.sa-body--auth {
    padding-top: 0 !important;
    overflow: hidden;
    background: #fff;
}

/* ══════════════════════════════════════════════════════════════
   LOGIN — split panel  (color LEFT · form RIGHT)
   ══════════════════════════════════════════════════════════════ */
.sa-auth {
    display: grid;
    grid-template-columns: 45fr 55fr;
    /* brand izquierda, formulario derecha */
    height: 100vh;
    overflow: hidden;
}

/* ── Panel izquierdo: COLOR + IMAGEN ───────────────────────── */
.sa-auth__brand {
    position: relative;
    background: #A3B7A6;
    /* color secondary */
    overflow: hidden;
    z-index: 1;
}

/* Foto de fondo que rellena el panel de color */
.sa-auth__brand-img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/assets/img/front/catalogo.jpeg');
    background-size: cover;
    background-position: center;
    z-index: 0;
}

/* ── Panel derecho: FORMULARIO blanco ───────────────────────── */
/* Se superpone sobre el panel de color con esquinas izquierdas redondeadas */
.sa-auth__panel {
    background: #f4efea;
    border-radius: 28px 0 0 28px;
    margin-left: -28px;
    box-shadow: -8px 0 32px rgba(0, 0, 0, .14);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem clamp(2.5rem, 5vw, 5rem);
    position: relative;
    z-index: 2;
}

.sa-auth__panel-inner {
    width: 100%;
    max-width: 380px;
}

.sa-auth__brand-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: clamp(2rem, 4vw, 3rem);
    background: linear-gradient(160deg,
            rgba(30, 55, 35, 0.72) 0%,
            rgba(50, 80, 55, 0.55) 50%,
            rgba(20, 42, 24, 0.78) 100%);
}

.sa-auth__brand-logo {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
}

.sa-auth__brand-logo img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.sa-auth__brand-logo span {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: rgba(255, 255, 255, .92);
    letter-spacing: .06em;
}

.sa-auth__brand-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 0;
}

.sa-auth__brand-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 2.2vw, 2.2rem);
    font-weight: 300;
    color: #fff;
    line-height: 1.25;
    letter-spacing: -.01em;
    margin-bottom: 1rem;
}

.sa-auth__brand-text {
    font-size: .88rem;
    color: rgba(255, 255, 255, .6);
    line-height: 1.75;
    max-width: 26ch;
    margin: 0;
}

.sa-auth__brand-trust {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .15);
}

.sa-auth__brand-trust li {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .76rem;
    color: rgba(255, 255, 255, .55);
}

.sa-auth__brand-trust li i {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: .72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Logo visible solo en móvil */
.sa-auth__mobile-logo {
    display: none;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    margin-bottom: 2rem;
}

.sa-auth__mobile-logo img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.sa-auth__mobile-logo span {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--color-primary-dark);
}

/* ── Botón Google ───────────────────────────────────────────── */
.sa-auth__google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    width: 100%;
    height: 46px;
    border: 1.5px solid #d8d8d8;
    border-radius: 6px;
    background: #fff;
    color: #3c3c3c;
    font: inherit;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
    margin-bottom: 0;
}

.sa-auth__google-btn:hover {
    border-color: #aaa;
    background: #fafafa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    color: #1a1a1a;
}

.sa-auth__google-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Separador — OR — */
.sa-auth__divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    color: #bbb;
    font-size: .78rem;
    letter-spacing: .08em;
}

.sa-auth__divider::before,
.sa-auth__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8e8e8;
}

/* Título */
.sa-auth__title {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 2.5vw, 2.2rem);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1.75rem;
    letter-spacing: -.02em;
    line-height: 1.2;
}

/* ── Formulario ─────────────────────────────────────────────── */
.sa-auth__form {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

.sa-auth__field {
    display: flex;
    flex-direction: column;
}

/* Input estilo underline — igual que la referencia */
.sa-auth__input {
    width: 100%;
    height: 44px;
    padding: 0 2.5rem 0 0;
    border: none;
    border-bottom: 1.5px solid #d0d0d0;
    border-radius: 0;
    background: transparent;
    color: #1a1a1a;
    font: inherit;
    font-size: .95rem;
    outline: none;
    transition: border-color .18s;
}

.sa-auth__input::placeholder {
    color: #bbb;
    font-size: .93rem;
}

.sa-auth__input:focus {
    outline: 2px solid transparent; /* sustituido por box-shadow */
    border-bottom-color: #7B2D3E;
    box-shadow: 0 2px 0 0 #7B2D3E;
}

.sa-auth__input.is-invalid {
    border-bottom-color: #c0392b;
}

/* Wrap para el campo de contraseña (tiene botón ojo) */
.sa-auth__input-wrap {
    position: relative;
}

.sa-auth__input-wrap .sa-auth__input {
    padding-right: 2.5rem;
}

/* Botón mostrar/ocultar contraseña */
.sa-auth__toggle-pw {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #bbb;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s;
}

.sa-auth__toggle-pw:hover {
    color: #555;
}

/* Error */
.sa-auth__error {
    font-size: .76rem;
    color: #c0392b;
    margin-top: .3rem;
}

/* Hint / pista de campo */
.sa-auth__hint {
    display: block;
    font-size: .76rem;
    color: #888;
    margin-top: .3rem;
    line-height: 1.4;
}
.sa-auth__hint i {
    margin-right: .2rem;
}

/* Fila recordarme + olvidé contraseña */
.sa-auth__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: .1rem;
}

.sa-auth__check {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .84rem;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.sa-auth__check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #7B2D3E;
    cursor: pointer;
    flex-shrink: 0;
}

.sa-auth__link-muted {
    font-size: .82rem;
    color: #888;
    text-decoration: none;
    transition: color .15s;
}

.sa-auth__link-muted:hover {
    color: #7B2D3E;
}

/* Botón principal */
.sa-auth__submit {
    width: 100%;
    height: 50px;
    margin-top: .4rem;
    border: none;
    border-radius: 6px;
    background: #7B2D3E;
    color: #fff;
    font: inherit;
    font-size: .88rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .18s, box-shadow .18s, transform .12s;
    box-shadow: 0 4px 14px rgba(123, 45, 62, .3);
}

.sa-auth__submit:hover {
    background: #5e2030;
    box-shadow: 0 6px 20px rgba(123, 45, 62, .4);
    transform: translateY(-1px);
}

.sa-auth__submit:active {
    transform: translateY(0);
}

/* Alertas */
.sa-auth__alert {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .7rem .9rem;
    border-radius: 6px;
    font-size: .85rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.sa-auth__alert--success {
    background: #eafaf1;
    color: #1e7e49;
    border: 1px solid rgba(30, 126, 73, .2);
}

.sa-auth__alert--error {
    background: #fdf2f2;
    color: #c0392b;
    border: 1px solid rgba(192, 57, 43, .2);
}

.sa-auth__alert--info {
    background: #eef4ff;
    color: #1d4ed8;
    border: 1px solid rgba(29, 78, 216, .2);
}

/* Footer "¿No tienes cuenta?" */
.sa-auth__footer-link {
    margin-top: 1.5rem;
    text-align: center;
    font-size: .88rem;
    color: #888;
}

.sa-auth__footer-link a {
    color: #7B2D3E;
    font-weight: 600;
    text-decoration: none;
}

.sa-auth__footer-link a:hover {
    text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════
   REGISTER — clases propias (sa-auth-*)
   ══════════════════════════════════════════════════════════════ */
.sa-auth-page {
    min-height: 100vh;
    background: var(--bg-body);
}

.sa-auth-shell {
    display: grid;
    grid-template-columns: 45fr 55fr;
    min-height: 100vh;
}

.sa-auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, rgba(25, 8, 12, .96) 0%, rgba(62, 28, 35, .9) 55%, rgba(15, 5, 8, .98) 100%);
    padding: clamp(2rem, 4vw, 3rem);
}

.sa-auth-brand::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #A3B7A6 30%, #A3B7A6 70%, transparent);
}

.sa-auth-brand__logo {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
}

.sa-auth-brand__logo-img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: .85;
}

.sa-auth-brand__logo-text {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: rgba(255, 255, 255, .88);
    letter-spacing: .06em;
}

.sa-auth-brand__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 0;
}

.sa-auth-brand__eyebrow {
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--color-secondary);
    margin-bottom: .75rem;
}

.sa-auth-brand__title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 2.4vw, 2.2rem);
    font-weight: 300;
    color: #fff;
    line-height: 1.25;
    letter-spacing: -.01em;
    margin-bottom: 1rem;
}

.sa-auth-brand__subtitle {
    font-size: .9rem;
    color: rgba(255, 255, 255, .45);
    line-height: 1.75;
    max-width: 28ch;
    margin: 0;
}

.sa-auth-brand__trust {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.sa-auth-brand__trust-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .78rem;
    color: rgba(255, 255, 255, .38);
}

.sa-auth-brand__trust-item i {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(163, 183, 166, .1);
    color: var(--color-secondary);
    font-size: .72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sa-auth-panel {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem;
}

.sa-auth-panel__inner {
    width: 100%;
    max-width: 420px;
    padding: 1rem 0;
}

.sa-auth-mobile-logo {
    display: none;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    margin-bottom: 2rem;
}

.sa-auth-card__logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.sa-auth-mobile-logo__text {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--color-primary-dark);
}

.sa-auth-panel__title {
    font-family: var(--font-heading);
    font-size: clamp(1.65rem, 2.3vw, 2.1rem);
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1.6rem;
    letter-spacing: -.02em;
}

.sa-auth-panel__subtitle {
    font-size: .9rem;
    color: #888;
    margin-bottom: 1.6rem;
    line-height: 1.6;
}

.sa-auth-alert {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .7rem .9rem;
    border-radius: 6px;
    font-size: .85rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.sa-auth-alert--error {
    background: #fdf2f2;
    color: #c0392b;
    border: 1px solid rgba(192, 57, 43, .2);
}

.sa-auth-form {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.sa-auth-field {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.sa-auth-field label {
    font-size: .78rem;
    font-weight: 600;
    color: #555;
    letter-spacing: .03em;
}

.sa-auth-input-wrap {
    position: relative;
}

.sa-auth-icon {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: .85rem;
    pointer-events: none;
}

.sa-auth-input {
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    background: #fff;
    color: #1a1a1a;
    font: inherit;
    font-size: .92rem;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}

.sa-auth-input::placeholder {
    color: #aaa;
}

.sa-auth-input:focus {
    border-color: #7B2D3E;
    box-shadow: 0 0 0 3px rgba(123, 45, 62, .12);
}

.sa-auth-input.is-invalid {
    border-color: #c0392b;
}

.sa-auth-toggle-password {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #bbb;
    cursor: pointer;
    font-size: .95rem;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color .15s;
}

.sa-auth-toggle-password:hover {
    color: #555;
}

.sa-auth-error {
    font-size: .75rem;
    color: #c0392b;
}

.sa-auth-submit {
    width: 100%;
    height: 48px;
    margin-top: .3rem;
    border: none;
    border-radius: 6px;
    background: #7B2D3E;
    color: #fff;
    font: inherit;
    font-size: .88rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .18s, box-shadow .18s, transform .12s;
    box-shadow: 0 4px 14px rgba(123, 45, 62, .3);
}

.sa-auth-submit:hover {
    background: #5e2030;
    box-shadow: 0 6px 20px rgba(123, 45, 62, .4);
    transform: translateY(-1px);
}

.sa-auth-submit:active {
    transform: translateY(0);
}

.sa-auth-links {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    text-align: center;
    font-size: .86rem;
    color: #888;
}

.sa-auth-links a {
    color: #7B2D3E;
    font-weight: 600;
    text-decoration: none;
}

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

/* ══════════════════════════════════════════════════════════════
   FORGOT & RESET — tarjeta centrada
   ══════════════════════════════════════════════════════════════ */
.sa-auth--centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    background: var(--bg-body);
}

.sa-auth__card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: clamp(1.8rem, 5vw, 2.8rem);
    box-shadow: 0 4px 24px rgba(0, 0, 0, .08);
}

.sa-auth__card-logo {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.sa-auth__card-logo img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.sa-auth__card-logo span {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--color-primary-dark);
}

.sa-auth__card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(163, 183, 166, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-secondary-dark);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
    .sa-auth {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .sa-body--auth {
        overflow: auto;
    }

    .sa-auth__brand {
        display: none;
    }

    .sa-auth__panel {
        min-height: 100vh;
        justify-content: center;
        align-items: center;
        padding: 2.5rem 1.5rem;
        border-radius: 0;
        margin-left: 0;
        box-shadow: none;
    }

    .sa-auth__panel-inner {
        max-width: 100%;
    }

    .sa-auth__mobile-logo {
        display: flex;
    }

    .sa-auth__brand-img {
        right: 0;
        mask-image: none;
        -webkit-mask-image: none;
    }

    /* Register */
    .sa-auth-shell {
        grid-template-columns: 1fr;
    }

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

    .sa-auth-panel {
        min-height: 100vh;
        padding: 2.5rem 1.5rem;
        align-items: flex-start;
    }

    .sa-auth-panel__inner {
        max-width: 100%;
    }

    .sa-auth-mobile-logo {
        display: flex;
    }
}

@media (max-width: 480px) {
    .sa-auth__panel {
        padding: 2rem 1.25rem;
    }

    .sa-auth-panel {
        padding: 2rem 1.25rem;
    }

    .sa-auth__card {
        border: none;
        box-shadow: none;
        padding: 2rem 1rem;
    }
}