/* ============================================================
   account/login — Hoja de estilos
   Diseño moderno, accesible (WCAG 2.2 AA) y responsive.
   Coherente con la identidad del sitio (amarillo de marca).
   No contiene lógica; solo presentación.
   ============================================================ */

/* Variables compartidas por la versión de página completa y la de modal */
.auth-page, .auth-modal {
    --auth-primary:        #ffc107;
    --auth-primary-dark:   #ffab00;
    --auth-ink:            #1f2430;
    --auth-ink-soft:       #5b6270;
    --auth-bg:             #f4f6fb;
    --auth-card:           #ffffff;
    --auth-border:         #e3e7ef;
    --auth-border-strong:  #cdd3e0;
    --auth-danger:         #d9363e;
    --auth-success:        #1b8a3a;
    --auth-radius:         18px;
    --auth-field-h:        50px;
}

/* Layout de página completa (login.blade) */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 3rem) 1rem;
    background: linear-gradient(135deg, rgba(18, 20, 28, 0.4) 0%, rgba(18, 20, 28, 0.7) 100%),
                url('../../images/ecuador_login_shopping_bg.png') no-repeat center center / cover;
}

/* Variante compacta para el modal de login (dentro de .modal-body) */
.auth-modal { display: block; }
.auth-modal .auth-main { padding: .25rem; }
.auth-modal .auth-mobilehead { display: block; }   /* logo siempre visible en el modal */
.auth-modal .auth-title { font-size: 1.35rem; }

/* ── Tarjeta dividida ── */
.auth-card {
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    box-shadow: 0 24px 60px rgba(20, 25, 40, .12);
    overflow: hidden;
    animation: auth-rise .45s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Panel de marca (izquierda) ── */
.auth-aside {
    position: relative;
    color: #fff;
    padding: 2.5rem 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    background: linear-gradient(155deg, #23283a 0%, #2e3550 55%, #3a3320 100%);
    overflow: hidden;
}
.auth-aside::after { /* acento de marca */
    content: "";
    position: absolute;
    right: -40%; top: -30%;
    width: 90%; height: 70%;
    background: radial-gradient(closest-side, rgba(255,193,7,.35), transparent);
    pointer-events: none;
}
.auth-aside__brand { display: flex; align-items: center; gap: .65rem; position: relative; }
.auth-aside__brand img { height: 40px; width: auto; }
.auth-aside__headline { font-size: 1.6rem; font-weight: 800; line-height: 1.25; margin: 0 0 .5rem; position: relative; }
.auth-aside__sub { color: rgba(255,255,255,.78); font-size: .95rem; margin: 0; position: relative; }

.auth-features { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .75rem; position: relative; }
.auth-features li { display: flex; align-items: flex-start; gap: .6rem; font-size: .9rem; color: rgba(255,255,255,.9); }
.auth-features i { color: var(--auth-primary); margin-top: .15rem; }

.auth-aside__secure {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .8rem; color: rgba(255,255,255,.72); position: relative;
}
.auth-aside__secure i { color: #7fe0a0; }

/* ── Panel del formulario (derecha) ── */
.auth-main { padding: clamp(1.75rem, 4vw, 3rem); display: flex; flex-direction: column; }

/* Encabezado compacto (solo visible en móvil) */
.auth-mobilehead { display: none; text-align: center; margin-bottom: 1.25rem; }
.auth-mobilehead img { height: 46px; width: auto; }

.auth-title { font-size: 1.5rem; font-weight: 800; color: var(--auth-ink); margin: 0 0 .35rem; letter-spacing: -.01em; }
.auth-subtitle { font-size: .95rem; color: var(--auth-ink-soft); margin: 0 0 1.5rem; }

/* ── Alertas de error (accesibles) ── */
.auth-alert {
    display: flex; align-items: flex-start; gap: .6rem;
    background: #fdecec; border: 1px solid #f6c6c8; color: #8f1f24;
    border-radius: 12px; padding: .75rem .9rem; margin-bottom: 1.25rem;
    font-size: .88rem; line-height: 1.35;
}
.auth-alert i { margin-top: .12rem; color: var(--auth-danger); }
.auth-alert ul { margin: .25rem 0 0; padding-left: 1.1rem; }

/* ── Campos ── */
.auth-field { margin-bottom: 1.1rem; }
.auth-label {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .82rem; font-weight: 700; color: var(--auth-ink);
    margin-bottom: .4rem;
}
.auth-label .auth-req { color: var(--auth-danger); }

.auth-inputwrap { position: relative; display: flex; align-items: center; }
.auth-inputwrap > i.auth-icon {
    position: absolute; left: 14px; color: var(--auth-ink-soft);
    font-size: .95rem; pointer-events: none;
}
.auth-input {
    width: 100%;
    height: var(--auth-field-h);
    padding: 0 44px 0 42px;
    font-size: .95rem;
    color: var(--auth-ink);
    background: #fff;
    border: 1.5px solid var(--auth-border-strong);
    border-radius: 12px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
    appearance: none;
}
.auth-input::placeholder { color: #aab0bd; }
.auth-input:hover { border-color: #b7bece; }
.auth-input:focus {
    outline: none;
    border-color: var(--auth-primary-dark);
    box-shadow: 0 0 0 4px rgba(255,193,7,.28);
    background: #fffdf6;
}

/* Estados de validación */
.auth-input.is-invalid { border-color: var(--auth-danger); }
.auth-input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(217,54,62,.18); }
.auth-input.is-valid { border-color: var(--auth-success); }

.auth-error {
    display: none;
    align-items: center; gap: .35rem;
    color: var(--auth-danger); font-size: .78rem; margin-top: .4rem;
}
.auth-error.show { display: flex; }

/* Botón mostrar/ocultar contraseña */
.auth-toggle-password {
    position: absolute; right: 6px;
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: 9px;
    color: var(--auth-ink-soft); cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.auth-toggle-password:hover { background: #f1f3f8; color: var(--auth-ink); }
.auth-toggle-password:focus-visible { outline: 2px solid var(--auth-primary-dark); outline-offset: 2px; }

/* Aviso de Bloq Mayús */
.auth-caps {
    display: none; align-items: center; gap: .35rem;
    margin-top: .45rem; font-size: .78rem; color: #9a6a00;
    background: #fff7e0; border: 1px solid #ffe4a3;
    padding: .25rem .5rem; border-radius: 8px;
}
.auth-caps.show { display: inline-flex; }

/* Fila recordar / olvidé */
.auth-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; flex-wrap: wrap; margin: .25rem 0 1.4rem;
}
.auth-check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; }
.auth-check input { width: 18px; height: 18px; accent-color: var(--auth-primary-dark); cursor: pointer; }
.auth-check span { font-size: .86rem; color: var(--auth-ink-soft); }
.auth-link { font-size: .86rem; font-weight: 700; color: var(--auth-primary-dark); text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

/* ── Botón principal ── */
.auth-submit {
    position: relative;
    width: 100%; min-height: 50px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 700; color: #201a00;
    background: var(--auth-primary);
    border: 1.5px solid var(--auth-primary);
    border-radius: 12px; cursor: pointer;
    transition: transform .12s ease, background .18s ease, box-shadow .18s ease;
}
.auth-submit:hover { background: var(--auth-primary-dark); border-color: var(--auth-primary-dark); box-shadow: 0 8px 20px rgba(255,171,0,.38); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:focus-visible { outline: 3px solid rgba(255,171,0,.5); outline-offset: 2px; }
.auth-submit:disabled, .auth-submit.is-loading { cursor: not-allowed; opacity: .9; }

.auth-submit .btn-content,
.auth-submit .loading-spinner { display: inline-flex; align-items: center; gap: .5rem; }
.auth-submit .loading-spinner { display: none; }
.auth-submit.is-loading .btn-content { display: none; }
.auth-submit.is-loading .loading-spinner { display: inline-flex; }

/* ── Separador ── */
.auth-divider { display: flex; align-items: center; text-align: center; color: var(--auth-ink-soft); margin: 1.4rem 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-bottom: 1px solid var(--auth-border); }
.auth-divider span { padding: 0 .75rem; font-size: .8rem; }

/* ── Botones sociales / secundarios ── */
.auth-social {
    width: 100%; min-height: 48px;
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    font-weight: 600; color: var(--auth-ink);
    background: #fff; border: 1.5px solid var(--auth-border-strong); border-radius: 12px;
    text-decoration: none; transition: background .15s ease, border-color .15s ease;
}
.auth-social:hover { background: #f7f8fb; border-color: #b7bece; color: var(--auth-ink); }
.auth-social:focus-visible { outline: 2px solid var(--auth-primary-dark); outline-offset: 2px; }
.auth-social img { width: 20px; height: 20px; }

.auth-foot { margin-top: auto; padding-top: 1.5rem; text-align: center; }
.auth-foot .muted { font-size: .86rem; color: var(--auth-ink-soft); margin-bottom: .5rem; }
.auth-create {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    width: 100%; min-height: 48px;
    font-weight: 700; color: var(--auth-primary-dark);
    background: transparent; border: 1.5px solid var(--auth-primary); border-radius: 12px;
    text-decoration: none; transition: background .15s ease, color .15s ease;
}
.auth-create:hover { background: rgba(255,193,7,.12); color: var(--auth-ink); }

.auth-secure-note {
    display: inline-flex; align-items: center; gap: .4rem;
    margin-top: 1.25rem; font-size: .76rem; color: var(--auth-ink-soft);
}
.auth-secure-note i { color: var(--auth-success); }

/* ── Overlay de carga de página ── */
.page-loader-overlay {
    position: fixed; inset: 0; z-index: 9999;
    display: none; align-items: center; justify-content: center;
    background: rgba(255,255,255,.82); backdrop-filter: blur(2px);
}
.page-loader-overlay.is-active { display: flex; }
.page-loader-overlay .spinner-border { width: 3rem; height: 3rem; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 767.98px) {
    .auth-card { grid-template-columns: 1fr; max-width: 460px; }
    .auth-aside { display: none; }
    .auth-mobilehead { display: block; }
}

/* ============================================================
   Modo oscuro (según preferencia del sistema)
   ============================================================ */
@media (prefers-color-scheme: dark) {
    .auth-page, .auth-modal {
        --auth-ink: #eef1f7;
        --auth-ink-soft: #a7adbb;
        --auth-bg: #12141c;
        --auth-card: #1b1e28;
        --auth-border: #2b303d;
        --auth-border-strong: #39404f;
    }
    .auth-page {
        background: linear-gradient(135deg, rgba(18, 20, 28, 0.6) 0%, rgba(18, 20, 28, 0.9) 100%),
                    url('../../images/ecuador_login_shopping_bg.png') no-repeat center center / cover;
    }
    .auth-card { box-shadow: 0 24px 60px rgba(0,0,0,.5); }
    .auth-input { background: #232733; color: var(--auth-ink); }
    .auth-input:focus { background: #262b38; }
    .auth-social { background: #232733; color: var(--auth-ink); }
    .auth-social:hover { background: #2a2f3d; }
    .auth-alert { background: #3a2122; border-color: #6e2f32; color: #ffb4b7; }
    .auth-toggle-password:hover { background: #2a2f3d; }
    .page-loader-overlay { background: rgba(18,20,28,.85); }
}

/* ============================================================
   Accesibilidad: respetar "reducir movimiento"
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .auth-card { animation: none; }
    .auth-input, .auth-submit, .auth-social, .auth-toggle-password { transition: none; }
}
