/* ============================================================
   DeRevés — Sistema de diseño
   ============================================================ */

:root {
    /* Marca */
    --dereves-verde: #8AE234;
    --dereves-verde-suave: #A5D6A7;
    --dereves-gris: #202124;
    --dereves-azul: #00BFFF;
    --dereves-morado: #7C5CFF;
    --dereves-rojo: #FF6F61;

    /* Escala de verde */
    --green-700: #3f8f14;
    --green-600: #57a81a;
    --green-500: #73c41e;
    --green-400: #8AE234;
    --green-300: #a8ee63;
    --green-100: #e4f8c9;
    --green-50:  #f1fae3;

    /* Tinta / neutros */
    --ink:      #16191c;
    --ink-700:  #3a3f44;
    --ink-500:  #5f6368;
    --ink-300:  #9aa0a6;
    --bg:       #f5f8f2;
    --surface:  #ffffff;
    --line:     #e7ece0;

    /* Acentos */
    --amarillo: #ffb020;

    /* Gradientes */
    --grad-green: linear-gradient(135deg, #9bf04a 0%, #4eb52a 100%);
    --grad-hero:  radial-gradient(1200px 600px at 80% -10%, #d8f6b6 0%, rgba(216,246,182,0) 60%),
                  radial-gradient(900px 500px at 0% 110%, #cdeeff 0%, rgba(205,238,255,0) 55%),
                  linear-gradient(180deg, #ffffff 0%, #f4faec 100%);

    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(16,24,16,.06), 0 1px 3px rgba(16,24,16,.05);
    --shadow-md: 0 8px 22px -8px rgba(16,40,16,.18);
    --shadow-lg: 0 24px 50px -16px rgba(16,40,16,.28);
    --shadow-green: 0 10px 24px -8px rgba(91,184,42,.55);

    /* Radios */
    --radius-sm: 12px;
    --radius:    18px;
    --radius-lg: 28px;
    --radius-pill: 999px;

    /* Alias retrocompatibles (nombres viejos usados en algunos templates) */
    --verde-lima: var(--green-400);
    --verde:      var(--green-500);
    --morado:     var(--dereves-morado);
    --azul:       var(--dereves-azul);
    --gris:       var(--dereves-gris);
    --rojo:       var(--dereves-rojo);

    /* Armonización de Bootstrap: "primary" = verde de marca */
    --bs-primary: #57a81a;
    --bs-primary-rgb: 87, 168, 26;
    --bs-link-color: #3f8f14;
    --bs-link-color-rgb: 63, 143, 20;
    --bs-link-hover-color: #2f6e0d;
    --bs-border-radius: 12px;
    --bs-border-radius-lg: 16px;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg);
    color: var(--ink-700);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -.01em;
}

a { text-decoration: none; }

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--green-700);
    background: var(--green-50);
    border: 1px solid var(--green-100);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    font-weight: 800;
    margin: 14px 0 8px;
}

.section-subtitle {
    color: var(--ink-500);
    font-size: 1.05rem;
    max-width: 620px;
}

/* Realce de texto con gradiente */
.text-gradient {
    background: linear-gradient(120deg, #5fb524 0%, #8AE234 60%, #36c0ff 120%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Navbar ---------- */
.navbar {
    background: rgba(255,255,255,.82) !important;
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 1px 0 rgba(16,24,16,.06);
    padding-top: .6rem;
    padding-bottom: .6rem;
}

.navbar-brand { font-weight: 700; }
.navbar-brand img {
    transition: transform .3s ease;
    image-rendering: -webkit-optimize-contrast;
}
.navbar-brand:hover img { transform: scale(1.04); }

.navbar .nav-link {
    position: relative;
    font-weight: 500;
    color: var(--ink-700) !important;
    border-radius: var(--radius-pill);
    padding: .45rem .9rem !important;
    margin: 0 .1rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .2s ease, color .2s ease;
}
.navbar .nav-link:hover { background: var(--green-50); color: var(--green-700) !important; }
.navbar .nav-link.disabled { opacity: .55; }
.navbar .nav-link .material-symbols-rounded { font-size: 1.15rem; }

.navbar .dropdown-menu {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: .4rem;
}
.navbar .dropdown-item {
    border-radius: 10px;
    font-weight: 500;
    padding: .5rem .75rem;
}
.navbar .dropdown-item:hover { background: var(--green-50); color: var(--green-700); }

/* ---------- Botones ---------- */
.btn {
    font-weight: 600;
    border-radius: var(--radius-pill);
    padding: .6rem 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: transform .18s ease, box-shadow .25s ease, background .2s ease;
}
.btn .material-symbols-rounded { font-size: 1.2rem; }
.btn-lg { padding: .85rem 1.9rem; font-size: 1.02rem; }
.btn-sm { padding: .4rem 1rem; }

.btn-primary {
    background: var(--grad-green);
    border: none;
    color: #1a3d05;
    box-shadow: var(--shadow-green);
}
.btn-primary:hover,
.btn-primary:focus {
    background: var(--grad-green);
    color: #133003;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -8px rgba(91,184,42,.65);
}

.btn-dark {
    background: var(--ink);
    border: none;
    color: #fff;
    box-shadow: var(--shadow-md);
}
.btn-dark:hover { background: #000; color: #fff; transform: translateY(-2px); }

.btn-outline-primary {
    border: 1.5px solid var(--green-500);
    color: var(--green-700);
    background: #fff;
}
.btn-outline-primary:hover {
    background: var(--green-50);
    border-color: var(--green-600);
    color: var(--green-700);
    transform: translateY(-2px);
}

.btn-light, .btn-outline-light { border-radius: var(--radius-pill); font-weight: 600; }

/* ---------- Cards ---------- */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease, border-color .3s ease;
    overflow: hidden;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--green-100);
}
.card-img-top { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.card:hover .card-img-top { transform: scale(1.05); }

/* Tarjeta de feature */
.feature-card { text-align: center; padding: 2rem 1.4rem; height: 100%; }
.feature-ico {
    width: 72px; height: 72px;
    margin: 0 auto 1rem;
    display: grid; place-items: center;
    border-radius: 20px;
    font-size: 2.1rem;
    background: var(--green-50);
    color: var(--green-600);
    box-shadow: inset 0 0 0 1px var(--green-100);
}
.feature-ico .material-symbols-rounded { font-size: 2.1rem; }
.feature-ico.ico-azul   { background: #e6f8ff; color: #0093c4; box-shadow: inset 0 0 0 1px #c9eeff; }
.feature-ico.ico-morado { background: #efeaff; color: #5a3fd6; box-shadow: inset 0 0 0 1px #ded3ff; }
.feature-ico.ico-rojo   { background: #ffecea; color: #e0483a; box-shadow: inset 0 0 0 1px #ffd6d1; }

/* ---------- Hero ---------- */
.hero-section {
    position: relative;
    background: var(--grad-hero);
    color: var(--ink);
    padding: 96px 0 84px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}
.hero-section::before {
    /* malla de puntos sutil */
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(91,184,42,.10) 1px, transparent 1px);
    background-size: 24px 24px;
    -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 0%, transparent 75%);
    mask-image: radial-gradient(70% 60% at 50% 30%, #000 0%, transparent 75%);
    pointer-events: none;
}
.hero-section .container { position: relative; z-index: 1; }
.hero-section img { animation: fadeInDown .8s ease-out; }
.hero-section h1 {
    font-weight: 800;
    font-size: clamp(2.3rem, 5.2vw, 3.6rem);
    line-height: 1.07;
    margin-bottom: 18px;
}
.hero-section p.lead { font-size: 1.25rem; color: var(--ink-500); }

.hero-badges {
    display: flex; flex-wrap: wrap; gap: 10px 22px;
    justify-content: center; align-items: center;
    color: var(--ink-500); font-weight: 500; font-size: .95rem;
}
.hero-badge { display: inline-flex; align-items: center; gap: 7px; }
.hero-badge .material-symbols-rounded { color: var(--green-600); font-size: 1.25rem; }

/* Blobs decorativos */
.hero-blob {
    position: absolute; border-radius: 50%;
    filter: blur(55px); opacity: .5; z-index: 0; pointer-events: none;
}
.hero-blob.b1 { width: 320px; height: 320px; background: #aef06b; top: -80px; right: -60px; }
.hero-blob.b2 { width: 260px; height: 260px; background: #8fe3ff; bottom: -90px; left: -50px; opacity: .4; }

/* ---------- Pasos "cómo funciona" ---------- */
.step-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.2rem 1.5rem 1.6rem;
    height: 100%;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform .3s ease, box-shadow .3s ease;
}
.step-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.step-num {
    position: absolute; top: -18px; left: 24px;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 14px;
    font-weight: 800; font-size: 1.15rem;
    color: #1a3d05;
    background: var(--grad-green);
    box-shadow: var(--shadow-green);
}

/* ---------- Listado de complejos / cards genéricas ---------- */
.card-title { font-weight: 700; }
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .8rem; font-weight: 600;
    color: var(--ink-500);
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 4px 10px; border-radius: var(--radius-pill);
}
.chip .material-symbols-rounded { font-size: 1rem; }

/* Badge "Pronto" */
.badge { font-weight: 600; }

/* ---------- CTA grande ---------- */
.cta-band {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 3.2rem 2rem;
    text-align: center;
    color: #14310a;
    background: var(--grad-green);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.cta-band::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(420px 220px at 85% -20%, rgba(255,255,255,.45), transparent 60%);
    pointer-events: none;
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { color: #16330a; font-weight: 800; }

/* ---------- Footer ---------- */
footer {
    background: linear-gradient(180deg, #202124 0%, #16181a 100%);
    color: #d7dadf;
    padding: 56px 0 28px;
    margin-top: 72px;
}
footer h5, footer h6 { color: #fff; }
footer .footer-logo-chip {
    display: inline-flex;
    align-items: center;
    background: #fff;
    padding: 8px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
footer a, footer .text-white-50 { color: rgba(255,255,255,.62) !important; transition: color .2s ease; }
footer a:hover { color: var(--green-400) !important; }
footer .footer-link { display: inline-block; padding: 3px 0; }
footer hr { border-color: rgba(255,255,255,.12); }

/* ---------- Utilidades de texto de marca ---------- */
.text-verde-lima { color: var(--green-600); }
.text-azul { color: var(--dereves-azul); }
.text-morado { color: var(--dereves-morado); }
.text-naranja { color: var(--dereves-rojo); }
.material-symbols-rounded { vertical-align: middle; }

/* ---------- Formularios ---------- */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--line);
    padding: .6rem .85rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--green-400);
    box-shadow: 0 0 0 .2rem rgba(91,184,42,.18);
}
.form-label { font-weight: 600; color: var(--ink-700); margin-bottom: .35rem; }
.input-group-text { border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--bg); }

/* ---------- Badges ---------- */
.badge { padding: .42em .7em; border-radius: var(--radius-pill); font-weight: 600; letter-spacing: .01em; }

/* ---------- Alerts ---------- */
.alert {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.alert-info { background: #eaf6ff; border-color: #cfeaff; color: #0a5e80; }
.alert-success { background: var(--green-50); border-color: var(--green-100); color: #2c6312; }

/* ---------- List group (sidebars de perfil/dashboard) ---------- */
.list-group { border-radius: var(--radius); overflow: hidden; }
.list-group-item {
    border-color: var(--line);
    font-weight: 500;
    padding: .8rem 1rem;
    display: flex; align-items: center; gap: 10px;
    transition: background .2s ease, color .2s ease;
}
.list-group-item .material-symbols-rounded { font-size: 1.25rem; }
.list-group-item-action:hover { background: var(--green-50); color: var(--green-700); }
.list-group-item.active {
    background: var(--grad-green);
    border-color: transparent;
    color: #173b06;
    font-weight: 600;
}

/* ---------- Card headers de marca ---------- */
.card-header {
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}
.card-header.bg-primary { background: var(--grad-green) !important; color: #173b06 !important; }
.card-header.bg-primary .material-symbols-rounded { color: #173b06; }

/* ---------- Tablas ---------- */
.table { --bs-table-hover-bg: var(--green-50); }
.table > :not(caption) > * > * { padding: .85rem .9rem; }
.table thead th {
    text-transform: uppercase;
    font-size: .76rem;
    letter-spacing: .04em;
    color: var(--ink-500);
    border-bottom: 2px solid var(--line);
}

/* ---------- Avatar ---------- */
.avatar-circle {
    background: var(--grad-green) !important;
    color: #173b06 !important;
    box-shadow: var(--shadow-green);
}

/* ---------- Stat cards (dashboards) ---------- */
.stat-ico {
    width: 54px; height: 54px;
    display: grid; place-items: center;
    border-radius: 16px;
    background: var(--green-50);
    color: var(--green-600);
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Animaciones ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .navbar-brand img { height: 32px; }
    .hero-section { padding: 70px 0 60px; }
    .hero-section img { height: 110px !important; }
    footer img { height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
    body, .reveal, .card, .btn { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}
