/* ==========================================================================
   NEXO STORE — Login (layout auth)
   Simple, funcional y responsive.
   ========================================================================== */
:root {
    --brand: #6366f1;
    --brand-dark: #4f46e5;
    --brand-soft: #eef2ff;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;
    --radius: 16px;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-heading: 'Sora', 'Inter', ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Fondo decorativo ---------- */
.auth-bg { position: fixed; inset: 0; overflow: hidden; background: linear-gradient(135deg, #eef2ff, #f8fafc 55%, #f5f3ff); }
.auth-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 400px at 80% 10%, rgba(99, 102, 241, .12), transparent 60%);
}
.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
}
.auth-blob--1 { width: 380px; height: 380px; background: #c7d2fe; top: -120px; right: -80px; }
.auth-blob--2 { width: 300px; height: 300px; background: #fbcfe8; bottom: -100px; left: -60px; }
.auth-blob--3 { width: 220px; height: 220px; background: #a5f3fc; top: 40%; left: 30%; opacity: .35; }

/* ---------- Estructura ---------- */
.auth-wrap {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    padding: 2rem 1rem;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--text);
}
.auth-brand:hover { text-decoration: none; }
.auth-brand__mark {
    width: 40px; height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #7c3aed);
    box-shadow: 0 8px 20px rgba(79, 70, 229, .35);
}
.auth-brand__mark svg { width: 22px; height: 22px; }
.auth-brand__logo { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; }
.auth-brand__text em { font-style: normal; color: var(--brand); }

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2.4rem 2.2rem;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .12);
    animation: rise .6s var(--ease) both;
}
@keyframes rise {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: none; }
}

.auth-card__head { text-align: center; margin-bottom: 1.75rem; }
.auth-card__head h1 { font-family: var(--font-heading); font-size: 1.6rem; margin: 0 0 .35rem; letter-spacing: -.02em; }
.auth-card__head p { margin: 0; color: var(--text-muted); font-size: .9rem; }

.auth-foot { font-size: .85rem; color: var(--text-muted); }

/* ---------- Formulario ---------- */
.auth-form { display: flex; flex-direction: column; gap: 1.15rem; }

.field { display: flex; flex-direction: column; gap: .45rem; }
.field label { font-size: .85rem; font-weight: 600; }
.field__label-row { display: flex; align-items: center; justify-content: space-between; }
.field__link { font-size: .8rem; }
.field__error { font-size: .78rem; color: var(--danger); min-height: 1em; }

.auth-alert {
    padding: .75rem 1rem;
    border-radius: 10px;
    font-size: .85rem;
    line-height: 1.45;
}
.auth-alert--error {
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .35);
    color: var(--danger);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.input-wrap > svg {
    position: absolute;
    left: .9rem;
    width: 18px; height: 18px;
    color: #94a3b8;
    pointer-events: none;
}
.input-wrap input {
    width: 100%;
    padding: .8rem 1rem .8rem 2.6rem;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font-size: .92rem;
    font-family: inherit;
    outline: none;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.input-wrap input::placeholder { color: #94a3b8; }
.input-wrap input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
}
.input-wrap.is-invalid input { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(239, 68, 68, .1); }

.input-eye {
    position: absolute;
    right: .5rem;
    width: 34px; height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
}
.input-eye:hover { color: var(--text); background: var(--brand-soft); }
.input-eye svg { width: 18px; height: 18px; }

.auth-row { display: flex; align-items: center; justify-content: space-between; }

.check { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text-muted); cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .82rem 1.4rem;
    border: 0;
    border-radius: 12px;
    font-size: .92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease);
}
.btn--primary { background: linear-gradient(135deg, var(--brand), #7c3aed); color: #fff; box-shadow: 0 10px 22px rgba(79, 70, 229, .35); }
.btn--primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(79, 70, 229, .42); }
.btn--primary:disabled { opacity: .7; cursor: not-allowed; }
.btn--block { width: 100%; }

.spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #94a3b8;
    font-size: .78rem;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.social { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.social__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .7rem;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: #fff;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: border-color .18s var(--ease), background-color .18s var(--ease), transform .18s var(--ease);
}
.social__btn:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-2px); }
.social__btn svg { width: 17px; height: 17px; }

.auth-switch { text-align: center; font-size: .88rem; color: var(--text-muted); margin: 0; }
.auth-switch a { font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .auth-card { padding: 1.9rem 1.4rem; }
    .social { grid-template-columns: 1fr; }
}
