/* ═══════════════════════════════════════════════════════════════
   PlanImplant — Sistema de diseño v2
   Estética clínica premium: azul marino de marca + acento lima
   Tipografía: Sora (títulos) · Inter (texto)
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
    /* Color de marca (logo) */
    --navy:        #364C84;
    --navy-deep:   #25355F;
    --navy-ink:    #1A2440;
    --navy-soft:   #5B74B8;
    --navy-tint:   #EEF2FA;

    /* Acento de marca (material gráfico) */
    --lime:        #E9F0A9;
    --lime-strong: #D5E26B;

    /* Azul claro de marca (periwinkle) + crema */
    --peri:        #95B1EE;
    --peri-deep:   #4660A6;
    --peri-tint:   #EDF1FB;
    --cream:       #FAF8F1;
    --border-cool: #D5DEEF;

    /* Neutros */
    --bg:          #FFFFFF;
    --bg-soft:     #F5F7FC;
    --border:      #E2E7F2;
    /* Texto sobre fondo claro → negro (sin grises) */
    --text:        #111418;
    --text-muted:  #111418;

    /* Semánticos */
    --success-bg:  #EAF7EE;
    --success-fg:  #1B6B3A;
    --error-bg:    #FDEEEE;
    --error-fg:    #B3261E;

    /* Tipografía */
    --font-head: 'Sora', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;

    /* Ritmo */
    --radius-sm: 10px;
    --radius:    16px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 3px rgba(26, 36, 64, .06), 0 4px 14px rgba(26, 36, 64, .05);
    --shadow-md: 0 6px 24px rgba(26, 36, 64, .09);
    --shadow-lg: 0 18px 50px rgba(26, 36, 64, .16);
    --container: 1180px;
    --header-h:  76px;

    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 12px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; background: none; border: none; }

::selection { background: var(--lime); color: var(--navy-ink); }

:focus-visible {
    outline: 3px solid var(--navy-soft);
    outline-offset: 3px;
    border-radius: 4px;
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    color: var(--navy-ink);
    line-height: 1.18;
    letter-spacing: -0.02em;
    font-weight: 600;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 24px;
}

/* ── Botones ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 50px;
    padding: .85rem 1.7rem;
    border-radius: 999px;
    font-family: var(--font-head);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease),
                background-color .2s var(--ease), color .2s var(--ease),
                border-color .2s var(--ease);
}
.btn:active { transform: scale(.97); }

.btn-primary {
    background: var(--navy);
    color: #fff;
}
.btn-primary:hover {
    background: var(--navy-deep);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid rgba(54, 76, 132, .35);
}
.btn-outline:hover {
    border-color: var(--navy);
    background: var(--navy-tint);
    transform: translateY(-2px);
}

.btn-lime {
    background: var(--lime);
    color: var(--navy-ink);
}
.btn-lime:hover {
    background: var(--lime-strong);
    transform: translateY(-2px);
}

.btn-full { width: 100%; }

/* ── Cabecera ───────────────────────────────────────────────── */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.site-header.scrolled {
    border-bottom-color: var(--border);
    box-shadow: 0 2px 16px rgba(26, 36, 64, .06);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.logo img { height: 42px; width: auto; }

.main-nav ul {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: .35rem .85rem;
    border-radius: 999px;
    font-size: .92rem;
    font-weight: 500;
    color: var(--text);
    transition: color .2s var(--ease), background-color .2s var(--ease);
}
.main-nav a:hover { color: var(--navy); background: var(--navy-tint); }
.main-nav a.is-active { color: var(--navy); background: var(--navy-tint); }

.main-nav .nav-cta {
    margin-left: .5rem;
    background: var(--navy);
    color: #fff;
    padding-inline: 1.3rem;
    font-weight: 600;
}
.main-nav .nav-cta:hover { background: var(--navy-deep); color: #fff; }

.main-nav .nav-client {
    width: 44px;
    justify-content: center;
    border: 1.5px solid var(--border);
    color: var(--navy);
}
.main-nav .nav-client:hover { border-color: var(--navy); }

/* Hamburguesa */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 48px;
    height: 48px;
    align-items: center;
    border-radius: var(--radius-sm);
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--navy-ink);
    border-radius: 2px;
    transition: transform .25s var(--ease), opacity .2s var(--ease);
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Secciones: comunes ─────────────────────────────────────── */
main { display: block; }

section { padding: 96px 0; }

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--font-head);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--navy);
    margin-bottom: 1rem;
}
.section-eyebrow::before {
    content: "";
    width: 26px;
    height: 3px;
    border-radius: 2px;
    background: var(--lime-strong);
}

section h2 {
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    max-width: 24ch;
    margin-bottom: 1.1rem;
}

.section-head { margin-bottom: 3.25rem; }

.section-intro {
    font-size: 1.08rem;
    color: var(--text-muted);
    max-width: 62ch;
}

.section-closing {
    margin-top: 3rem;
    font-family: var(--font-head);
    font-size: 1.06rem;
    font-weight: 500;
    color: var(--navy-deep);
    max-width: 58ch;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
    position: relative;
    padding: calc(var(--header-h) + 72px) 0 110px;
    background:
        radial-gradient(800px 460px at 88% -10%, rgba(233, 240, 169, .55), transparent 65%),
        radial-gradient(900px 520px at -12% 16%, rgba(54, 76, 132, .08), transparent 60%),
        var(--bg);
    overflow: hidden;
}

.hero::after {
    /* malla técnica sutil */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(54, 76, 132, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(54, 76, 132, .045) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(640px 420px at 78% 30%, #000 30%, transparent 75%);
    mask-image: radial-gradient(640px 420px at 78% 30%, #000 30%, transparent 75%);
    pointer-events: none;
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 4rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem 1rem;
    border-radius: 999px;
    background: var(--lime);
    color: var(--navy-ink);
    font-family: var(--font-head);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
    margin-bottom: 1.5rem;
}
.hero-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--navy);
}

.hero h1 {
    font-size: clamp(2.2rem, 4.8vw, 3.4rem);
    font-weight: 700;
    margin-bottom: 1.1rem;
}

.hero-subtitle {
    font-family: var(--font-head);
    font-size: 1.18rem;
    font-weight: 500;
    color: var(--navy);
    margin-bottom: 1.25rem;
}

.hero-text {
    color: var(--text-muted);
    max-width: 56ch;
    margin-bottom: .9rem;
}
.hero-text:last-of-type { font-weight: 500; color: var(--text); }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .9rem;
    margin-top: 2rem;
}

/* Imagen del hero */
.hero-visual { position: relative; }

.hero-visual::before {
    content: "";
    position: absolute;
    inset: 12% -6% -8% 14%;
    background: linear-gradient(140deg, var(--lime) 0%, rgba(233, 240, 169, .25) 100%);
    border-radius: var(--radius-lg);
    transform: rotate(-3deg);
    z-index: 0;
}

.hero-frame {
    position: relative;
    z-index: 1;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow-lg);
}
.hero-frame img { border-radius: var(--radius-sm); }

.hero-chip {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .55rem 1.05rem;
    font-family: var(--font-head);
    font-size: .82rem;
    font-weight: 600;
    color: var(--navy-ink);
    box-shadow: var(--shadow-md);
}
.hero-chip i { color: var(--navy); font-size: .95rem; }
.hero-chip--tl { top: -1.1rem; left: -1.4rem; }
.hero-chip--br { bottom: -1.2rem; right: .6rem; }

/* ── Proceso ────────────────────────────────────────────────── */
.how-we-work { background: var(--bg-soft); }

.process-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
}

.process-step {
    position: relative;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.9rem 1.7rem 1.7rem;
    overflow: hidden;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.process-step:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(54, 76, 132, .28);
}

.process-step .step-number {
    position: absolute;
    top: .4rem;
    right: 1.1rem;
    font-family: var(--font-head);
    font-size: 4.2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--navy-tint);
    user-select: none;
    pointer-events: none;
}

.process-step .step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--navy-tint);
    color: var(--navy);
    font-size: 1.25rem;
    margin-bottom: 1.2rem;
    transition: background-color .25s var(--ease), color .25s var(--ease);
}
.process-step:hover .step-icon { background: var(--navy); color: var(--lime); }

.process-step h3 {
    font-size: 1.08rem;
    margin-bottom: .6rem;
}

.process-step p { font-size: .94rem; color: var(--text-muted); }

/* ── Servicios (bento) ──────────────────────────────────────── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.4rem;
}

.service-card {
    grid-column: span 6;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(54, 76, 132, .28);
}

.service-card:nth-child(1) { grid-column: span 7; }
.service-card:nth-child(2) { grid-column: span 5; }
.service-card:nth-child(3) { grid-column: span 5; }
.service-card:nth-child(4) { grid-column: span 7; }

/* Tarjeta destacada en marino */
.service-card--featured {
    background: var(--navy);
    border-color: var(--navy-deep);
}
.service-card--featured h3 { color: #fff; }
.service-card--featured .service-tagline { color: var(--lime); }
/* Compuesto para ganar a `.service-card > p` y `.service-items li` (misma especificidad) */
.service-card.service-card--featured > p,
.service-card.service-card--featured .service-items li { color: #fff; }
.service-card--featured .service-icon {
    background: rgba(255, 255, 255, .12);
    color: var(--lime);
}
.service-card--featured:hover { box-shadow: 0 18px 44px rgba(37, 53, 95, .38); }

.service-header {
    display: flex;
    align-items: flex-start;
    gap: 1.05rem;
}

.service-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: var(--navy-tint);
    color: var(--navy);
    font-size: 1.3rem;
}

.service-card h3 { font-size: 1.18rem; margin-bottom: .2rem; }

.service-tagline {
    font-family: var(--font-head);
    font-size: .86rem;
    font-weight: 500;
    color: var(--navy-soft);
}

.service-card > p { color: var(--text-muted); font-size: .96rem; }

.service-items {
    display: flex;
    flex-direction: column;
    gap: .8rem;
}
.service-items li {
    position: relative;
    padding-left: 1.7rem;
    font-size: .96rem;
    color: var(--text-muted);
}
.service-items li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .42em;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: var(--lime-strong);
    box-shadow: 0 0 0 3px var(--lime);
}

/* ── Sobre mí ───────────────────────────────────────────────── */
.about { background: var(--bg-soft); }

.about-grid {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 4.5rem;
    align-items: center;
}

.about-visual { position: relative; }

.about-visual::before {
    content: "";
    position: absolute;
    inset: -16px auto auto -16px;
    width: 60%;
    height: 60%;
    border: 3px solid var(--lime-strong);
    border-radius: var(--radius-lg);
    z-index: 0;
}

.about-visual img {
    position: relative;
    z-index: 1;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    object-fit: cover;
}

.about-card {
    position: absolute;
    z-index: 2;
    left: -1.4rem;
    bottom: 1.8rem;
    background: var(--navy);
    color: #fff;
    border-radius: var(--radius);
    padding: .95rem 1.35rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: .8rem;
}
.about-card i { color: var(--lime); font-size: 1.2rem; }
.about-card span {
    font-family: var(--font-head);
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.3;
}

.about-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.about-highlight {
    margin: 1.6rem 0 1rem;
    padding: 1.3rem 1.6rem;
    background: #fff;
    border-left: 4px solid var(--lime-strong);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--navy-deep);
    box-shadow: var(--shadow-sm);
}

/* ── Por qué trabajar juntos (banda oscura) ─────────────────── */
.why-us {
    background: var(--navy);
    color: #fff;
}

.why-us .section-eyebrow { color: var(--lime); }
.why-us .section-eyebrow::before { background: var(--lime); }
.why-us h2 { color: #fff; }
.why-us .section-intro { color: #fff; }

.why-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.3rem;
}

.why-card {
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius);
    padding: 1.8rem 1.5rem;
    transition: transform .25s var(--ease), background-color .25s var(--ease), border-color .25s var(--ease);
}
.why-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, .09);
    border-color: rgba(233, 240, 169, .4);
}

.why-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 13px;
    background: rgba(233, 240, 169, .14);
    color: var(--lime);
    font-size: 1.2rem;
    margin-bottom: 1.1rem;
}

.why-card h3 { color: #fff; font-size: 1.05rem; margin-bottom: .55rem; }
.why-card p { font-size: .92rem; color: #fff; }

.why-footer {
    margin-top: 3.2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.why-us .section-closing {
    margin-top: 0;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 600;
}

/* ── FAQ ────────────────────────────────────────────────────── */
.faq .faq-wrap { max-width: 820px; margin-inline: auto; }
.faq .section-head { text-align: center; }
.faq .section-eyebrow { justify-content: center; }
.faq h2 { margin-inline: auto; }

.faq-list {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

.faq-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.faq-item.active {
    border-color: rgba(54, 76, 132, .35);
    box-shadow: var(--shadow-sm);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-family: var(--font-head);
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--navy-ink);
    min-height: 56px;
}

.faq-marker {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--navy-tint);
    color: var(--navy);
    transition: transform .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease);
}
.faq-item.active .faq-marker {
    background: var(--navy);
    color: var(--lime);
    transform: rotate(45deg);
}

.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .3s var(--ease);
}
.faq-item.active .faq-answer { grid-template-rows: 1fr; }
.faq-answer > div { overflow: hidden; }

.faq-answer p,
.faq-answer ul {
    padding: 0 1.5rem 1.4rem;
    color: var(--text-muted);
    font-size: .97rem;
}

.faq-check-list { display: flex; flex-direction: column; gap: .65rem; }
.faq-check-list li { display: flex; gap: .7rem; align-items: flex-start; }
.faq-check-list i { color: var(--navy); margin-top: .25rem; flex-shrink: 0; }

/* ── Contacto ───────────────────────────────────────────────── */
.contact { background: var(--bg-soft); padding-bottom: 110px; }

.contact-panel {
    display: grid;
    grid-template-columns: .9fr 1.35fr;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.contact-aside {
    background: var(--navy);
    color: #fff;
    padding: 3rem 2.6rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.contact-aside .section-eyebrow { color: var(--lime); margin-bottom: 0; }
.contact-aside .section-eyebrow::before { background: var(--lime); }

.contact-aside h2 { color: #fff; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.contact-aside p { color: #fff; font-size: .98rem; }

.contact-mail {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    color: #fff;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .98rem;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(255, 255, 255, .15);
}
.contact-mail i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(233, 240, 169, .15);
    color: var(--lime);
    flex-shrink: 0;
}
.contact-mail:hover { color: var(--lime); }

.contact-form { padding: 3rem 2.8rem; }

/* ── Formularios ────────────────────────────────────────────── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.form-group { margin-bottom: 1.2rem; }

.form-group label {
    display: block;
    font-family: var(--font-head);
    font-size: .86rem;
    font-weight: 600;
    color: var(--navy-ink);
    margin-bottom: .45rem;
}

.required { color: var(--error-fg); }
.optional { color: var(--text-muted); font-weight: 400; }

.form-group input,
.form-group textarea {
    width: 100%;
    min-height: 50px;
    padding: .8rem 1.05rem;
    font: inherit;
    font-size: .96rem;
    color: var(--navy-ink);
    background: var(--bg-soft);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.form-group textarea { resize: vertical; min-height: 130px; }

.form-group input::placeholder,
.form-group textarea::placeholder { color: #9AA3BC; }

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--navy);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(54, 76, 132, .12);
}

.form-group input.error,
.form-group textarea.error {
    border-color: var(--error-fg);
    background: var(--error-bg);
}

.form-error-msg {
    display: none;
    font-size: .82rem;
    color: var(--error-fg);
    margin-top: .35rem;
}

/* Alertas */
.alert {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: 1.05rem 1.3rem;
    border-radius: var(--radius-sm);
    font-size: .95rem;
    margin-bottom: 1.8rem;
}
.alert::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-top: .1rem;
}
.alert-success { background: var(--success-bg); color: var(--success-fg); border: 1px solid #BBE3C8; }
.alert-success::before { content: "\f058"; }
.alert-error { background: var(--error-bg); color: var(--error-fg); border: 1px solid #F2C4C1; }
.alert-error::before { content: "\f071"; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
    background: var(--navy-ink);
    color: #fff;
    padding: 64px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.1fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer-brand .logo img {
    height: 40px;
    width: auto;
    /* logo marino → blanco sobre fondo oscuro */
    filter: brightness(0) invert(1);
    opacity: .95;
}
.footer-brand p {
    margin-top: 1.1rem;
    font-size: .94rem;
    max-width: 34ch;
}

.site-footer h4 {
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.footer-links a {
    color: #fff;
    font-size: .94rem;
    transition: color .2s var(--ease);
}
.footer-links a:hover { color: var(--lime); }

.footer-contact a {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: #fff;
    font-size: .95rem;
}
.footer-contact a:hover { color: var(--lime); }
.footer-contact i { color: var(--lime); }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding: 1.4rem 0;
    font-size: .85rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

/* ── Login ──────────────────────────────────────────────────── */
.login-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.2rem;
    background:
        radial-gradient(700px 420px at 85% -5%, rgba(233, 240, 169, .5), transparent 60%),
        radial-gradient(800px 500px at -10% 105%, rgba(54, 76, 132, .14), transparent 60%),
        var(--bg-soft);
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.8rem 2.4rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo img { height: 46px; width: auto; margin-inline: auto; }

.login-card h1 {
    font-size: 1.45rem;
    margin: 1.5rem 0 .4rem;
}

.login-sub {
    font-size: .94rem;
    color: var(--text-muted);
    margin-bottom: 1.8rem;
}

.login-form { text-align: left; }

.login-note {
    margin-top: 1.4rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem 1rem;
    border-radius: 999px;
    background: var(--lime);
    color: var(--navy-ink);
    font-family: var(--font-head);
    font-size: .8rem;
    font-weight: 600;
}

.login-back {
    display: block;
    margin-top: 1.4rem;
    font-size: .9rem;
    color: var(--text-muted);
}
.login-back:hover { color: var(--navy); }

/* ── Página de error ────────────────────────────────────────── */
.error-page {
    min-height: calc(100dvh - var(--header-h));
    display: flex;
    align-items: center;
    text-align: center;
}
.error-page .error-code {
    font-family: var(--font-head);
    font-size: clamp(5rem, 14vw, 8rem);
    font-weight: 700;
    line-height: 1;
    color: var(--navy-tint);
    -webkit-text-stroke: 2px var(--navy);
}
.error-page h1 { font-size: 1.6rem; margin: 1rem 0 .6rem; }
.error-page p { color: var(--text-muted); margin-bottom: 2rem; }

/* ── Animaciones de entrada ─────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
}
.reveal.visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* ═══ Responsive ═══════════════════════════════════════════── */
@media (max-width: 1024px) {
    section { padding: 76px 0; }

    .hero-grid { gap: 2.6rem; }

    .process-grid { grid-template-columns: repeat(2, 1fr); }

    .why-grid { grid-template-columns: repeat(2, 1fr); }

    .service-card:nth-child(n) { grid-column: span 6; }

    .about-grid { gap: 3rem; }
}

@media (max-width: 860px) {
    .hero { padding: calc(var(--header-h) + 44px) 0 80px; }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3.4rem;
    }
    .hero-visual { max-width: 560px; margin-inline: auto; }

    .about-grid { grid-template-columns: 1fr; }
    /* width:100% rompe la dependencia circular (img width:100% + margin auto)
       que colapsaba .about-visual a 0×0 ocultando la foto en móvil/tablet */
    .about-visual { width: 100%; max-width: 480px; margin-inline: auto; }

    .contact-panel { grid-template-columns: 1fr; }
    .contact-aside { padding: 2.4rem 1.8rem; }
    .contact-form { padding: 2.4rem 1.8rem; }

    /* Navegación móvil */
    .nav-toggle { display: flex; }

    .main-nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        padding: 1.2rem 1.5rem 1.6rem;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
    }
    .main-nav.open {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: .2rem;
    }
    .main-nav a {
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
        border-radius: var(--radius-sm);
    }
    .main-nav .nav-cta {
        margin-left: 0;
        margin-top: .6rem;
        justify-content: center;
    }
    .main-nav .nav-client {
        width: 100%;
        justify-content: center;
        gap: .6rem;
    }
    .main-nav .nav-client::after {
        content: "Área de clientes";
        font-size: .95rem;
    }
}

@media (max-width: 640px) {
    section { padding: 64px 0; }
    .container { padding-inline: 20px; }

    .section-head { margin-bottom: 2.4rem; }

    .process-grid { grid-template-columns: 1fr; }
    .why-grid { grid-template-columns: 1fr; }
    /* Servicios a 1 columna: la rejilla de 12 col dejaba las tarjetas en 2
       columnas de ~140px con el texto roto y desbordando en horizontal */
    .services-grid { grid-template-columns: 1fr; }
    .service-card:nth-child(n) { grid-column: 1 / -1; }
    .service-card { padding: 1.7rem; }

    .form-row { grid-template-columns: 1fr; gap: 0; }

    .hero-actions .btn { width: 100%; }

    .hero-chip--tl { top: -1rem; left: 0; }
    .hero-chip--br { bottom: -1rem; right: 0; }

    .about-card { left: 0; }

    .footer-content { grid-template-columns: 1fr; gap: 2.2rem; }
    .footer-bottom { justify-content: center; text-align: center; }

    .why-footer { justify-content: center; text-align: center; }
}

/* ── Enlaces legales del footer ─────────────────────────────── */
.footer-legal {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
}
.footer-legal a {
    color: rgba(255, 255, 255, .68);
    transition: color .2s var(--ease);
}
.footer-legal a:hover { color: var(--lime); }
.footer-legal span { opacity: .4; }

/* ── Páginas legales ────────────────────────────────────────── */
.legal-page {
    padding: calc(var(--header-h) + 56px) 0 96px;
    background:
        radial-gradient(680px 420px at 88% -8%, rgba(149, 177, 238, .16), transparent 62%),
        var(--cream);
    min-height: calc(100dvh - var(--header-h));
}

.legal-doc {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: clamp(1.8rem, 4vw, 3.4rem);
}

.legal-crumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 1.6rem;
}
.legal-crumb a { color: var(--peri-deep); transition: color .2s var(--ease); }
.legal-crumb a:hover { color: var(--navy); }
.legal-crumb span[aria-hidden] { opacity: .5; }

.legal-head {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.4rem;
    margin-bottom: 2rem;
}
.legal-head h1 {
    font-family: var(--font-head);
    color: var(--navy-ink);
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    line-height: 1.15;
}
.legal-updated {
    margin-top: .6rem;
    font-size: .88rem;
    color: var(--text-muted);
}

.legal-body { color: var(--text); line-height: 1.75; }
.legal-body h2 {
    font-family: var(--font-head);
    color: var(--navy);
    font-size: 1.3rem;
    margin: 2.2rem 0 .9rem;
}
.legal-body h3 {
    font-family: var(--font-head);
    color: var(--navy-deep);
    font-size: 1.05rem;
    margin: 1.5rem 0 .6rem;
}
.legal-body p { margin-bottom: 1.05rem; }
.legal-body ul,
.legal-body ol {
    margin: 0 0 1.2rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.legal-body li { padding-left: .2rem; }
.legal-body a {
    color: var(--peri-deep);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .2s var(--ease);
}
.legal-body a:hover { color: var(--navy); }
.legal-body strong { color: var(--navy-ink); }

.legal-data {
    list-style: none;
    margin: 1.4rem 0 1.6rem !important;
    padding: 1.3rem 1.5rem;
    background: var(--peri-tint);
    border: 1px solid var(--border-cool);
    border-radius: var(--radius-sm);
}
.legal-data li { padding-left: 0 !important; }

.legal-foot {
    margin-top: 2.6rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: .92rem;
}
.legal-foot a { color: var(--peri-deep); transition: color .2s var(--ease); }
.legal-foot a:hover { color: var(--navy); }
.legal-back { font-weight: 600; }

/* ── Casilla de consentimiento del formulario ───────────────── */
.form-consent { margin-bottom: 1.5rem; }
.consent-label {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    font-size: .9rem;
    line-height: 1.5;
    color: var(--text);
    cursor: pointer;
}
.consent-label input[type="checkbox"] {
    flex: none;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: .12rem;
    accent-color: var(--navy);
    cursor: pointer;
}
.consent-label input[type="checkbox"].error {
    outline: 2px solid var(--error-fg);
    outline-offset: 2px;
    border-radius: 4px;
}
.consent-label a {
    color: var(--peri-deep);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.consent-label a:hover { color: var(--navy); }

/* ── Banner de cookies ──────────────────────────────────────── */
.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 1.4rem;
    transform: translate(-50%, calc(100% + 2rem));
    width: min(960px, calc(100% - 2rem));
    z-index: 1200;
    background: var(--navy-ink);
    color: rgba(255, 255, 255, .9);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.cookie-banner.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}
.cookie-banner-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 1.2rem 1.5rem;
}
.cookie-banner-text {
    margin: 0;
    font-size: .9rem;
    line-height: 1.55;
}
.cookie-banner-text a {
    color: var(--lime);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cookie-banner .cookie-accept {
    flex: none;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .legal-page { padding-top: calc(var(--header-h) + 32px); }
    .cookie-banner-inner { flex-direction: column; align-items: stretch; text-align: center; }
    .cookie-banner .cookie-accept { width: 100%; }
}
