/* ==========================================================================
   SoyArrendador.com — public site design system
   Scoped entirely to views/layout/public.php. The authenticated panel keeps
   using styles.css untouched.
   ========================================================================== */

:root {
    --color-ink: #16181d;
    --color-ink-soft: #4b5160;
    --color-muted: #767c8c;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f5f1;
    --color-line: #e8e2d9;
    --color-accent: #f2711c;
    --color-accent-dark: #cf5c0f;
    --color-accent-soft: #fff1e3;
    --color-success: #1f8a52;
    --color-success-soft: #e7f6ee;
    --color-danger: #c23b3b;
    --color-danger-soft: #fbeaea;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-card: 0 12px 32px rgba(22, 24, 29, 0.08);
    --shadow-card-hover: 0 18px 40px rgba(22, 24, 29, 0.13);
    --container-w: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-ink);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 {
    font-family: var(--font-sans);
    line-height: 1.2;
    color: var(--color-ink);
    margin: 0 0 16px;
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }

p { margin: 0 0 16px; color: var(--color-ink-soft); }
ul, ol { color: var(--color-ink-soft); padding-left: 22px; }
li { margin-bottom: 6px; }

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

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--color-ink);
    color: #fff;
    padding: 10px 16px;
    z-index: 1000;
    border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* -------------------------------- Buttons -------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary, .btn-primary:visited {
    background: var(--color-accent);
    color: #fff;
    box-shadow: 0 10px 24px rgba(242, 113, 28, 0.32);
}
.btn-primary:hover, .btn-primary:visited:hover { background: var(--color-accent-dark); color: #fff; }

.btn-outline, .btn-outline:visited {
    background: transparent;
    border-color: var(--color-ink);
    color: var(--color-ink);
}
.btn-outline:hover, .btn-outline:visited:hover { background: var(--color-ink); color: #fff; }

.btn-ghost, .btn-ghost:visited {
    background: transparent;
    color: var(--color-ink);
    padding: 13px 18px;
}
.btn-ghost:hover, .btn-ghost:visited:hover { background: var(--color-bg-alt); color: var(--color-ink); }

.btn-block { width: 100%; }

.link-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-accent-dark);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

/* --------------------------------- Header -------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--color-line);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.brand img { height: 34px; width: auto; }

.nav-toggle-label {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--color-line);
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-ink);
    position: relative;
    transition: transform 0.15s ease;
}
.nav-toggle-label span::before { content: ''; position: absolute; top: -6px; }
.nav-toggle-label span::after { content: ''; position: absolute; top: 6px; }
#nav-toggle { display: none; }

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 26px;
    margin: 0;
    padding: 0;
}
.main-nav a {
    color: var(--color-ink-soft);
    font-weight: 600;
    font-size: 0.94rem;
}
.main-nav a:hover, .main-nav a.active { color: var(--color-accent-dark); text-decoration: none; }

.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-cta-mobile { display: none; }

/* ---------------------------------- Hero --------------------------------- */

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 128px 0 104px;
    min-height: 560px;
    display: flex;
    align-items: center;
}
.hero-cover {
    position: absolute;
    inset: 0;
    z-index: -1;
}
.hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
}
.hero-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(16, 17, 21, 0.92) 0%, rgba(16, 17, 21, 0.72) 42%, rgba(16, 17, 21, 0.28) 75%, rgba(16, 17, 21, 0.1) 100%);
}
.hero .container { position: relative; }
.hero-card { max-width: 620px; }
.hero-card h1, .hero-card p { color: #fff; }
.hero-card p { font-size: 1.08rem; color: rgba(255, 255, 255, 0.86); }
.eyebrow {
    display: inline-block;
    background: var(--color-accent-soft);
    color: var(--color-accent-dark);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.hero-card .btn-outline, .hero-card .btn-outline:visited {
    border-color: rgba(255, 255, 255, 0.75);
    color: #fff;
}
.hero-card .btn-outline:hover, .hero-card .btn-outline:visited:hover {
    background: #fff;
    color: var(--color-ink);
}
.hero-facts {
    display: flex;
    gap: 28px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.hero-fact strong { display: block; font-size: 1.5rem; color: #fff; }
.hero-fact span { font-size: 0.82rem; color: rgba(255, 255, 255, 0.7); }

/* ------------------------------- Page header ------------------------------ */

.page-header {
    padding: 56px 0 12px;
    text-align: center;
}
.page-header .eyebrow { display: inline-block; }
.page-header p.lead {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.08rem;
}

/* ------------------------------- Sections -------------------------------- */

section { padding: 56px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-heading-wrap { text-align: center; max-width: 720px; margin: 0 auto 40px; }

.split-section .container {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 48px;
    align-items: center;
}
.split-section img { border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.split-section.reverse .container { direction: rtl; }
.split-section.reverse .container > * { direction: ltr; }

/* ------------------------------- Card grids ------------------------------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.feature-card {
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    padding: 28px 26px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.feature-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--color-accent-soft);
    color: var(--color-accent-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.feature-icon svg { width: 24px; height: 24px; }

.value-columns .container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.value-columns ul { list-style: none; padding: 0; }
.value-columns li {
    padding: 8px 0 8px 28px;
    position: relative;
    border-bottom: 1px solid var(--color-line);
}
.value-columns li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-accent);
}

/* --------------------------------- Steps ---------------------------------- */

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    counter-reset: step;
}
.step-card { position: relative; padding-top: 8px; }
.step-card::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-ink);
    color: #fff;
    font-weight: 800;
    margin-bottom: 16px;
}

/* ---------------------------------- Stats ---------------------------------- */

.stats-band {
    background: var(--color-ink);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 40px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}
.stats-band strong { display: block; font-size: 2rem; color: #fff; }
.stats-band span { color: rgba(255, 255, 255, 0.72); font-size: 0.88rem; }

/* --------------------------------- Pricing --------------------------------- */

.pricing-section { padding-top: 48px; }
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    align-items: stretch;
}
.pricing-photo { grid-column: 1 / -1; }
.pricing-photo img { border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.pricing-card {
    position: relative;
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
}
.pricing-card.tier-plata { border-color: var(--color-accent); box-shadow: var(--shadow-card-hover); transform: translateY(-6px); }
.tier-name { font-weight: 800; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-accent-dark); }
.pricing-card ul { flex: 1; list-style: none; padding: 0; margin: 18px 0; }
.pricing-card li {
    padding: 8px 0 8px 26px;
    position: relative;
    font-size: 0.92rem;
    border-bottom: 1px dashed var(--color-line);
}
.pricing-card li::before { content: '✓'; position: absolute; left: 0; color: var(--color-success); font-weight: 800; }
.price { font-size: 2rem; font-weight: 800; margin: 6px 0 4px; }
.price-billing { display: block; font-size: 0.8rem; font-weight: 600; color: var(--color-muted); margin-bottom: 14px; }
.badge-best {
    position: absolute;
    top: -14px;
    right: 20px;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.2;
    padding: 8px 12px;
    border-radius: 999px;
    text-align: center;
}
.pricing-note { max-width: 900px; margin: 32px auto 0; font-size: 0.82rem; color: var(--color-muted); text-align: center; }

/* ----------------------------------- FAQ ------------------------------------ */

.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item {
    border-bottom: 1px solid var(--color-line);
    padding: 6px 0;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 1.02rem;
    padding: 14px 28px 14px 0;
    list-style: none;
    position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 12px;
    font-size: 1.4rem;
    color: var(--color-accent);
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { padding-bottom: 16px; }

/* ------------------------------- CTA banner --------------------------------- */

.cta-banner {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 48px;
    color: #fff;
    text-align: center;
}
.cta-banner h2 { color: #fff; }
.cta-banner p { color: rgba(255, 255, 255, 0.9); max-width: 600px; margin: 0 auto 24px; }
.cta-banner .btn-primary { background: #fff; color: var(--color-accent-dark); box-shadow: none; }
.cta-banner .btn-primary:hover { background: var(--color-ink); color: #fff; }

/* -------------------------------- Legal docs -------------------------------- */

.legal-updated {
    display: inline-block;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-line);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 0.8rem;
    color: var(--color-muted);
    margin-bottom: 24px;
}
.legal-toc {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    margin-bottom: 40px;
}
.legal-toc h2 { font-size: 1rem; margin-bottom: 12px; }
.legal-toc ol { columns: 2; column-gap: 32px; padding-left: 20px; }
.legal-toc li { font-size: 0.9rem; break-inside: avoid; }
.legal-body h2 { margin-top: 40px; scroll-margin-top: 90px; }
.legal-body h3 { margin-top: 24px; }

/* --------------------------------- Forms ------------------------------------ */

.auth-shell { padding: 64px 0 96px; background: var(--color-bg-alt); min-height: 60vh; }
.card {
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 36px;
}
.form-narrow { max-width: 460px; margin: 0 auto; }
.form-wide { max-width: 860px; margin: 0 auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.form-field label { font-weight: 600; font-size: 0.88rem; }
.form-field input, .form-field select, .form-field textarea {
    font: inherit;
    padding: 11px 14px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--color-ink);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
    border-color: var(--color-accent);
}
.form-error { color: var(--color-danger); font-size: 0.8rem; }
.form-check { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; font-size: 0.9rem; }
.form-check input { margin-top: 4px; }
.form-actions { margin-top: 22px; display: flex; justify-content: center; }
.form-actions .btn { width: 100%; }
.form-narrow .form-actions .btn,
.form-wide .form-actions .btn { width: auto; min-width: 220px; }

.alert { border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 20px; font-size: 0.92rem; }
.alert-success { background: var(--color-success-soft); color: var(--color-success); }
.alert-error { background: var(--color-danger-soft); color: var(--color-danger); }

.step-indicator { display: flex; gap: 24px; justify-content: center; margin-bottom: 32px; }
.step { color: var(--color-muted); font-weight: 600; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; }
.step-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.step.is-active { color: var(--color-accent-dark); }
.step-flag { font-size: 1rem; }

/* --------------------------------- Footer ------------------------------------ */

.site-footer {
    background: var(--color-ink);
    color: rgba(255, 255, 255, 0.75);
    padding: 56px 0 28px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-brand img { height: 30px; margin-bottom: 14px; filter: brightness(0) invert(1); }
.footer-brand p { color: rgba(255, 255, 255, 0.6); font-size: 0.88rem; }
.footer-col h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: rgba(255, 255, 255, 0.72); font-size: 0.92rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 24px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

/* -------------------------------- Responsive --------------------------------- */

@media (max-width: 960px) {
    .split-section .container { grid-template-columns: 1fr; }
    .split-section.reverse .container { direction: ltr; }
    .split-section .container > img { order: -1; }
    .hero { padding: 96px 0 72px; min-height: 480px; }
    .card-grid, .value-columns .container, .pricing-grid { grid-template-columns: repeat(2, 1fr); }
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-band { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .pricing-card.tier-plata { transform: none; }
}

@media (max-width: 680px) {
    .nav-toggle-label { display: flex; }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--color-line);
        box-shadow: var(--shadow-card);
    }
    .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 16px; }
    .main-nav li { border-bottom: 1px solid var(--color-line); }
    .main-nav a { display: block; padding: 14px 0; }
    #nav-toggle:checked ~ .main-nav { display: block; }
    .nav-cta { display: none; }
    #nav-toggle:checked ~ .main-nav .nav-cta-mobile { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; }

    .card-grid, .value-columns .container, .pricing-grid, .steps-grid, .stats-band { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .legal-toc ol { columns: 1; }
    .card { padding: 24px; }
    .form-grid { grid-template-columns: 1fr; }
}
