/* ============================================================
   Terrasa — Landing (claro · premium · minimalista)
   ============================================================ */
:root {
    --bg: #ffffff;
    --bg-soft: #f6f7f6;
    --ink: #0f1714;          /* casi negro, leve calidez verde */
    --ink-2: #3a4642;
    --muted: #7c8a85;
    --line: #e8ebe9;
    --line-2: #eef1ef;
    --brand: #006633;        /* verde Terrasa */
    --brand-press: #00522a;
    --radius: 18px;
    --shadow-sm: 0 1px 2px rgba(16, 32, 24, 0.05);
    --shadow-md: 0 14px 40px rgba(16, 40, 28, 0.12);
    --maxw: 1120px;
}

* { box-sizing: border-box; }

body.landing {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

[hidden] { display: none !important; }
img { display: block; max-width: 100%; }

/* ---------- Nav ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-logo { display: block; width: auto; height: 38px; }
.nav-name {
    font-weight: 800;
    font-size: 19px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1;
    color: var(--brand);
}
.nav-name small {
    display: block;
    font-weight: 500;
    font-size: 10.5px;
    letter-spacing: 0.04em;
    color: #4f7d64;
    margin-top: 4px;
    text-transform: lowercase;
}
.nav-link {
    font-size: 14px; font-weight: 600; color: var(--ink-2);
    text-decoration: none; padding: 9px 16px; border-radius: 999px;
    border: 1px solid var(--line); transition: all 0.16s ease;
}
.nav-link:hover { border-color: var(--brand); color: var(--brand); background: rgba(0, 102, 51, 0.04); }

/* ---------- Hero ---------- */
.hero {
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    padding: 76px 32px 44px;
    text-align: center;
}
.hero-eyebrow {
    margin: 0 0 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brand);
}
.hero-title {
    margin: 0;
    font-size: clamp(40px, 7vw, 72px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 0.98;
    color: var(--ink);
}
.hero-sub {
    margin: 20px auto 0;
    max-width: 540px;
    font-size: clamp(16px, 2vw, 19px);
    line-height: 1.55;
    color: var(--muted);
}
.hero-stats {
    margin: 32px 0 0;
    font-size: 15px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.hero-stats b { color: var(--ink); font-weight: 800; }
.hero-stats .dot { color: var(--line); }

/* ---------- Main ---------- */
.main {
    flex: 1;
    max-width: var(--maxw);
    width: 100%;
    margin: 0 auto;
    padding: 24px 32px 80px;
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 32px;
}
.section-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ink-2);
}
.count {
    font-size: 13px; font-weight: 600; color: var(--muted);
    background: var(--bg-soft); border: 1px solid var(--line);
    padding: 3px 11px; border-radius: 999px;
}

/* ---------- Grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 360px));
    justify-content: center;
    gap: 28px;
}

/* ---------- Card ---------- */
.card {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.24s cubic-bezier(.2,.7,.3,1), box-shadow 0.24s ease, border-color 0.24s ease;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--line);
}

/* Media: logo del proyecto (a color) sobre fondo claro, con franja de acento */
.card-media {
    position: relative;
    display: grid;
    place-items: center;
    height: 176px;
    padding: 22px;
    text-decoration: none;
    overflow: hidden;
    background:
        radial-gradient(130% 90% at 50% 0%,
            color-mix(in srgb, var(--c-accent, var(--brand)) 8%, #fff) 0%, #ffffff 70%);
    border-bottom: 1px solid var(--line);
}
/* Franja de acento de marca arriba */
.card-media::before {
    content: "";
    position: absolute; inset: 0 0 auto 0; height: 5px;
    background: linear-gradient(90deg,
        var(--c-primary, var(--brand)),
        var(--c-accent, var(--brand)));
}
.card-emblem {
    width: auto; height: auto;
    max-width: 78%;
    max-height: 116px;
    transition: transform 0.3s cubic-bezier(.2,.7,.3,1.3);
}
.card:hover .card-emblem { transform: scale(1.05); }
.card-tag {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--c-primary, var(--brand));
    padding: 6px 12px;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* Body */
.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px;
}
.card-titles { min-width: 0; }
.card-name {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
    line-height: 1.15;
}
.card-loc {
    margin: 3px 0 0;
    font-size: 13.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Meta */
.card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 18px 0 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line-2);
    font-size: 13px;
    color: var(--muted);
    flex-wrap: wrap;
}
.card-meta b { color: var(--ink); font-weight: 800; font-size: 14px; }
.card-meta-total { margin-left: auto; }

/* Acciones */
.card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}
.btn-primary {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 14.5px;
    padding: 13px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    background: var(--c-primary, var(--brand));
    transition: filter 0.16s ease, transform 0.16s ease;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: scale(0.985); }
.btn-icon {
    flex: 0 0 auto;
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border-radius: 12px;
    font-size: 18px;
    text-decoration: none;
    color: var(--ink-2);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    transition: all 0.16s ease;
}
.btn-icon:hover { background: #fff; border-color: var(--brand); color: var(--brand); }

/* Botón "Administrar" (solo visible con sesión de asesor) */
.btn-admin2 {
    flex: 0 0 auto;
    padding: 13px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    color: var(--c-primary, var(--brand));
    background: #fff;
    border: 1.5px solid var(--c-primary, var(--brand));
    transition: background 0.16s ease;
}
.btn-admin2:hover { background: color-mix(in srgb, var(--c-primary, var(--brand)) 9%, #fff); }

/* Botón de recorrido 360° en la card */
.btn-tour-card {
    flex: 0 0 auto;
    padding: 13px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    color: #fff;
    background: var(--c-accent, var(--brand));
    transition: filter 0.16s ease;
}
.btn-tour-card:hover { filter: brightness(1.08); }

/* Botón de cerrar sesión en el nav */
.nav-logout { background: var(--bg-soft); }

/* Barra de modo administrador */
.admin-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 32px;
    background: var(--ink);
    color: #fff;
    font-size: 14px;
}
.admin-bar b { font-weight: 800; }
.admin-bar-logout {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.32);
    padding: 7px 15px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.16s ease;
}
.admin-bar-logout:hover { background: rgba(255, 255, 255, 0.28); }

/* En modo admin, la barra superior del nav usa un acento sutil */
body.is-admin .nav { border-bottom-color: var(--brand); }

@media (max-width: 560px) {
    .admin-bar { flex-direction: column; gap: 8px; text-align: center; padding: 12px 20px; }
}

/* ---------- Card "Próximamente" ---------- */
.card--soon .card-media { filter: grayscale(0.55) brightness(0.9); cursor: default; }
.card--soon .card-emblem { opacity: 0.85; }
.card-tag--soon {
    background: rgba(15, 23, 20, 0.78) !important;
    color: #fff !important;
    backdrop-filter: blur(3px);
}
.card-soon {
    margin: 16px 0 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line-2);
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--muted);
}
.btn-disabled {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    padding: 13px 16px;
    border-radius: 12px;
    color: var(--muted);
    background: var(--bg-soft);
    border: 1px solid var(--line);
    cursor: default;
}

/* ---------- Estados (vacío / error) ---------- */
.state {
    text-align: center;
    padding: 72px 24px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--bg-soft);
}
.state h3 { margin: 0 0 8px; color: var(--ink); font-size: 18px; }
.state p { margin: 0 auto; max-width: 420px; color: var(--muted); font-size: 14.5px; }
.btn-retry {
    margin-top: 20px;
    background: var(--brand);
    color: #fff; border: none;
    font-weight: 700; font-size: 14px;
    padding: 11px 24px; border-radius: 12px;
    cursor: pointer; transition: background 0.16s ease;
}
.btn-retry:hover { background: var(--brand-press); }

/* ---------- Aviso de "despertando servidor" (cold start) ---------- */
.warmup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px auto 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}
.warmup-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--brand);
    animation: warmup-pulse 1.1s ease-in-out infinite;
}
@keyframes warmup-pulse {
    0%, 100% { opacity: 0.25; transform: scale(0.85); }
    50%      { opacity: 1;    transform: scale(1); }
}

/* ---------- Skeletons ---------- */
.skel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
}
.skel-media { height: 188px; }
.skel-body { padding: 20px; }
.skel-line { height: 13px; border-radius: 7px; margin-bottom: 12px; }
.skel-line.w70 { width: 70%; }
.skel-line.w45 { width: 45%; }
.skel-btn { height: 44px; border-radius: 12px; margin-top: 20px; }
.skel-media, .skel-line, .skel-btn {
    background: linear-gradient(100deg, #eef1ef 30%, #f7f9f8 50%, #eef1ef 70%);
    background-size: 200% 100%;
    animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Footer ---------- */
.foot {
    max-width: var(--maxw);
    width: 100%;
    margin: 0 auto;
    padding: 28px 32px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}
.foot-note { font-style: italic; opacity: 0.8; }

@media (max-width: 560px) {
    .hero { padding-top: 48px; }
    .nav, .hero, .main, .foot { padding-left: 20px; padding-right: 20px; }
    .foot { flex-direction: column; text-align: center; }
}
