/* =========================================================
   AREA AZUL — Mobile-first overrides sobre Tailwind CDN
   Reglas: tap-targets >= 44px, tipografía legible <=414px,
   coherencia de marca (acento #eb3a2f), foco accesible,
   safe-area iOS, sin overflow horizontal.
   ========================================================= */

:root {
    --area-red: #eb3a2f;
    --area-red-dark: #c8281d;
    --area-ink: #1f2937;
    --area-ink-soft: #4b5563;
    --area-bg: #f7f8fa;
    --area-card: #ffffff;
    --area-border: #e5e7eb;
    --area-radius: 14px;
    --area-radius-lg: 22px;
    --area-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    --area-shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --tap: 44px;
}

/* Reset defensivo: evitar zoom accidental y overflow */
html, body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;             /* evita zoom iOS en focus */
    line-height: 1.55;
    color: var(--area-ink);
    background: var(--area-bg);
    -webkit-font-smoothing: antialiased;
}

/* Imágenes y media fluidos por defecto */
img, video, svg { max-width: 100%; height: auto; }

/* ---------- Tipografía base ---------- */
h1, .h1 { font-size: clamp(1.6rem, 5.5vw, 2.4rem); line-height: 1.15; font-weight: 800; }
h2, .h2 { font-size: clamp(1.35rem, 4.5vw, 1.9rem); line-height: 1.2;  font-weight: 800; }
h3, .h3 { font-size: clamp(1.15rem, 3.8vw, 1.5rem); line-height: 1.25; font-weight: 700; }
h4, .h4 { font-size: clamp(1.02rem, 3.2vw, 1.2rem);  line-height: 1.3;  font-weight: 700; }
p, li, label, span, a { font-size: 1rem; }
.small { font-size: 0.875rem; }      /* 14px mínimo permitido */
.tiny  { font-size: 0.8125rem; }     /* 13px solo para legal/disclaimer */

/* ---------- Layout helpers (complementan Tailwind) ---------- */
.container-narrow {
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}
@media (min-width: 768px) {
    .container-narrow { padding-left: 24px; padding-right: 24px; }
}
@media (min-width: 1024px) {
    .container-narrow { padding-left: 32px; padding-right: 32px; }
}

/* ---------- Header / nav ---------- */
.area-header {
    background: linear-gradient(135deg, var(--area-red) 0%, var(--area-red-dark) 100%);
    color: #fff;
    padding-top: max(env(safe-area-inset-top), 0.5rem);
}
.area-header .nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
}
.area-header .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
    min-height: var(--tap);
}
.area-header .brand i { font-size: 1.25rem; }

.area-header .nav-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.area-header .btn-ghost,
.area-header .btn-outline {
    min-height: var(--tap);
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform .15s ease, background-color .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.area-header .btn-ghost {
    background: #fff;
    color: var(--area-red);
}
.area-header .btn-ghost:hover { background: #f3f4f6; }
.area-header .btn-ghost:active { transform: scale(0.97); }
.area-header .btn-outline {
    border: 2px solid #fff;
    color: #fff;
    background: transparent;
}
.area-header .btn-outline:hover { background: #fff; color: var(--area-red); }
.area-header .btn-outline:active { transform: scale(0.97); }

/* En pantallas muy estrechas: oculta el icono, deja solo la palabra clave */
@media (max-width: 360px) {
    .area-header .btn-ghost span.icon,
    .area-header .btn-outline span.icon { display: none; }
    .area-header .btn-ghost,
    .area-header .btn-outline { padding: 10px 12px; font-size: 0.9rem; }
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, var(--area-red) 0%, var(--area-red-dark) 100%);
    color: #fff;
    padding: 48px 16px 56px;
    text-align: center;
}
.hero h1 { margin-bottom: 12px; }
.hero p  { opacity: 0.95; margin-bottom: 24px; max-width: 56ch; margin-left: auto; margin-right: auto; }
.hero .hero-cta {
    min-height: var(--tap);
    padding: 14px 28px;
    border-radius: 999px;
    background: #fff;
    color: var(--area-red);
    font-weight: 800;
    font-size: 1.05rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--area-shadow);
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s ease, box-shadow .15s ease;
}
.hero .hero-cta:active { transform: scale(0.97); }
@media (min-width: 768px) {
    .hero { padding: 72px 24px 88px; }
}

/* ---------- Botones ---------- */
.btn {
    min-height: var(--tap);
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
    background: var(--area-red);
    color: #fff;
    box-shadow: 0 4px 14px rgba(235, 58, 47, 0.28);
}
.btn-primary:hover { background: var(--area-red-dark); }
.btn-secondary {
    background: #f3f4f6;
    color: var(--area-ink);
}
.btn-secondary:hover { background: #e5e7eb; }
.btn-outline-white {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}
.btn-outline-white:hover { background: #fff; color: var(--area-red); }

/* ---------- Cards ---------- */
.card {
    background: var(--area-card);
    border-radius: var(--area-radius-lg);
    box-shadow: var(--area-shadow);
    padding: 20px;
}
@media (min-width: 768px) { .card { padding: 28px; } }

/* ---------- Inputs ---------- */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    min-height: var(--tap);
    padding: 12px 14px;
    font-size: 1rem;            /* evita zoom iOS al enfocar */
    line-height: 1.4;
    color: var(--area-ink);
    background: #fff;
    border: 1.5px solid var(--area-border);
    border-radius: 12px;
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.input:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--area-red);
    box-shadow: 0 0 0 3px rgba(235, 58, 47, 0.18);
}

/* Labels */
label { display: inline-block; font-weight: 600; margin-bottom: 6px; color: var(--area-ink); }
.label-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--area-ink); font-weight: 600; }

/* Checkbox accesible (mínimo 24x24, área táctil real mayor) */
input[type="checkbox"] {
    width: 22px; height: 22px;
    min-height: 22px;
    accent-color: var(--area-red);
    cursor: pointer;
    flex-shrink: 0;
}
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
}
.checkbox-row label {
    font-size: 0.95rem;
    line-height: 1.45;
    font-weight: 500;
    margin: 0;
}

/* ---------- Mensajes / feedback ---------- */
.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-top: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.95rem;
    line-height: 1.45;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-ok    { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.alert-info  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert .icon { flex-shrink: 0; line-height: 1.4; }

/* ---------- Secciones ---------- */
.section {
    padding: 40px 16px;
}
.section--alt { background: #f1f5f9; }
@media (min-width: 768px) { .section { padding: 64px 24px; } }

.section-title {
    text-align: center;
    margin-bottom: 28px;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }

.steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 640px) { .steps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .steps-grid { grid-template-columns: repeat(4, 1fr); } }

.feature-card {
    text-align: center;
    padding: 24px 18px;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--area-shadow);
}
.feature-card .ico {
    width: 56px; height: 56px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 1.4rem;
}
.feature-card .ico--red    { background: #fee2e2; color: var(--area-red); }
.feature-card .ico--blue   { background: #dbeafe; color: #1d4ed8; }
.feature-card .ico--green  { background: #dcfce7; color: #047857; }
.feature-card h4 { margin-bottom: 8px; }
.feature-card p { color: var(--area-ink-soft); font-size: 0.95rem; }

.step-item { text-align: center; padding: 8px; }
.step-circle {
    width: 64px; height: 64px;
    border-radius: 999px;
    background: var(--area-red);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 12px;
}

/* ---------- Auth pages ---------- */
.auth-wrap {
    min-height: 100vh;
    min-height: 100dvh;                 /* mobile dynamic viewport */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    background: var(--area-bg);
}
.auth-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: var(--area-radius-lg);
    box-shadow: var(--area-shadow-md);
    padding: 24px 20px;
}
@media (min-width: 640px) { .auth-card { padding: 36px 32px; } }
.auth-header {
    text-align: center;
    margin-bottom: 24px;
}
.auth-header .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--area-red);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.25rem;
    min-height: var(--tap);
}
.auth-header .brand i { font-size: 1.5rem; }
.auth-header p { color: var(--area-ink-soft); margin-top: 6px; font-size: 0.95rem; }

.form-stack > * + * { margin-top: 16px; }
.row-between {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    font-size: 0.92rem;
}
.row-between a { color: var(--area-red); text-decoration: none; font-weight: 600; }
.row-between a:hover { text-decoration: underline; }

.divider-or {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--area-ink-soft);
    font-size: 0.85rem;
    margin: 18px 0;
}
.divider-or::before,
.divider-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--area-border);
}

.benefits {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 14px;
    padding: 16px 18px;
    margin-top: 18px;
}
.benefits h3 { color: var(--area-red); margin-bottom: 10px; font-size: 1.02rem; }
.benefits ul { list-style: none; padding: 0; margin: 0; }
.benefits li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
    color: var(--area-ink);
    font-size: 0.95rem;
}
.benefits li i { color: #047857; margin-top: 4px; }

.demo-hint {
    margin-top: 16px;
    text-align: center;
    color: var(--area-ink-soft);
    font-size: 0.85rem;
}

/* ---------- Footer ---------- */
.area-footer {
    background: #111827;
    color: #d1d5db;
    padding: 32px 16px;
    padding-bottom: max(32px, env(safe-area-inset-bottom));
}
.area-footer .footer-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
}
@media (min-width: 768px) {
    .area-footer .footer-row {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}
.area-footer h4 { color: #fff; font-weight: 700; }
.area-footer p { font-size: 0.9rem; color: #9ca3af; }
.area-footer .brand-line {
    display: inline-flex; align-items: center; gap: 8px;
    color: #fff; font-weight: 700; margin-bottom: 4px;
}

/* ---------- Utilidades ---------- */
.hidden { display: none !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.text-center { text-align: center; }
.text-muted  { color: var(--area-ink-soft); }

/* Foco accesible para usuarios de teclado */
:focus-visible {
    outline: 3px solid rgba(235, 58, 47, 0.55);
    outline-offset: 2px;
    border-radius: 8px;
}

/* Reduce motion: respeta preferencia del usuario */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* Dark mode automático (opcional, contraste mantenido) */
@media (prefers-color-scheme: dark) {
    body { background: #0f172a; color: #e2e8f0; }
    .card, .auth-card, .feature-card { background: #1e293b; color: #e2e8f0; }
    .section--alt { background: #0b1220; }
    .feature-card p, .text-muted { color: #94a3b8; }
    input, .input, select, textarea {
        background: #0b1220; color: #e2e8f0; border-color: #334155;
    }
    .btn-secondary { background: #334155; color: #e2e8f0; }
    .area-footer { background: #020617; }
    .benefits { background: #1f1010; border-color: #7f1d1d; }
    .alert-error { background: #1f1010; color: #fca5a5; border-color: #7f1d1d; }
    .alert-ok { background: #052e23; color: #6ee7b7; border-color: #065f46; }
}