/* ============================================================
   MediaClouding SAS — API de Streaming
   Paleta extraída del logo oficial:
     Turquesa: #03989E (primario)
     Verde:    #008037 (acento)
   ============================================================ */
:root {
    --teal-50:  #e6f7f7;
    --teal-100: #c2eded;
    --teal-200: #8fdedf;
    --teal-400: #2bb5b9;
    --teal-500: #03989E;
    --teal-600: #027276;
    --teal-700: #024d50;
    --teal-900: #012a2c;

    --green-500: #008037;
    --green-600: #006a2d;
    --green-100: #d4f0dc;

    --dark:    #0a1f21;
    --ink:     #0f2a2c;
    --text:    #243638;
    --muted:   #6b7d7f;
    --line:    #e3eaeb;
    --bg:      #ffffff;
    --bg-soft: #f6f9f9;

    --radius:  14px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(3,152,158,0.06), 0 2px 6px rgba(3,152,158,0.05);
    --shadow:   0 8px 28px rgba(3,152,158,0.12);
    --shadow-lg:0 24px 60px rgba(3,152,158,0.18);

    --grad-hero: linear-gradient(135deg, #e6f7f7 0%, #c2eded 50%, #d4f0dc 100%);
    --grad-primary: linear-gradient(135deg, #03989E 0%, #008037 100%);
    --grad-dark: linear-gradient(160deg, #024d50 0%, #0a1f21 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.75;
    letter-spacing: 0.1px;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-600); text-decoration: none; transition: color .15s; }
a:hover { color: var(--teal-500); }
img { max-width: 100%; display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.3rem;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(3,152,158,0.35);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(3,152,158,0.45); color: #fff; }
.btn-ghost {
    background: transparent;
    color: var(--teal-700);
    border-color: var(--teal-200);
}
.btn-ghost:hover:not(:disabled) { background: #fff; color: var(--teal-600); }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ---------- Topbar ---------- */
.topbar {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.25rem;
    gap: 1.5rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--ink);
    font-weight: 800;
    font-size: 1.15rem;
}
.brand img { height: 42px; width: auto; }
.brand small { color: var(--teal-500); font-weight: 600; font-size: 0.75rem; margin-left: 0.2rem; letter-spacing: 1px; }
.topnav-links { display: flex; gap: 1.8rem; }
.topnav-links a {
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}
.topnav-links a:hover { color: var(--teal-600); }
.topnav-toggle { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background: var(--grad-hero);
    overflow: hidden;
    padding: 4rem 0 5rem;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 90% 10%, rgba(0,128,55,0.12), transparent 60%),
        radial-gradient(ellipse 500px 400px at 0% 100%, rgba(3,152,158,0.18), transparent 60%);
    pointer-events: none;
}
.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
}
.eyebrow {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    background: rgba(255,255,255,0.7);
    color: var(--teal-600);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.4rem;
}
.eyebrow-dark {
    background: var(--teal-50);
    color: var(--teal-700);
}
.hero-copy { padding-right: 0.5rem; }
.hero h1 {
    font-size: clamp(2rem, 3.8vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--ink);
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
    max-width: 100%;
}
.hl {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}
.hero-text {
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--text);
    max-width: 100%;
    margin-bottom: 1.5rem;
}
.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0 0 1.5rem 0;
}
.hero-bullets {
    list-style: none;
    display: flex;
    gap: 1rem 2rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--teal-700);
    font-weight: 500;
    line-height: 1.5;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(3,152,158,0.15);
}
.hero-bullets li { padding: 0.2rem 0; }

.hero-visual {
    position: relative;
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

/* Imagen circular con anillo giratorio */
.hero-circle {
    position: relative;
    width: 280px;
    height: 280px;
    flex-shrink: 0;
}
.hero-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow:
        0 20px 50px rgba(3,152,158,0.32),
        0 0 0 6px #fff,
        0 0 0 8px rgba(3,152,158,0.22);
    animation: float 6s ease-in-out infinite;
    position: relative;
    z-index: 1;
}
.hero-ring {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background:
        conic-gradient(from 0deg,
            #03989E 0deg,
            #2bb5b9 90deg,
            #008037 180deg,
            #2bb54e 270deg,
            #03989E 360deg);
    -webkit-mask: radial-gradient(circle, transparent 56%, #000 58%, #000 64%, transparent 66%);
    mask: radial-gradient(circle, transparent 56%, #000 58%, #000 64%, transparent 66%);
    animation: spin 8s linear infinite;
    z-index: 0;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tarjetas a los lados (no encima) */
.hero-card {
    background: #fff;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(3,152,158,0.18);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    white-space: nowrap;
}
.hero-card strong { display: block; color: var(--ink); font-size: 0.85rem; line-height: 1.1; }
.hero-card small { color: var(--muted); font-size: 0.74rem; }
.hero-card-1 { animation: float 5s ease-in-out infinite; align-self: flex-start; margin-top: 0.5rem; }
.hero-card-2 { animation: float 5s ease-in-out infinite reverse; animation-delay: -2.5s; align-self: flex-end; margin-bottom: 0.5rem; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-live { background: var(--green-500); box-shadow: 0 0 0 4px rgba(0,128,55,0.2); animation: pulse 1.6s infinite; }
.dot-record { background: var(--teal-500); box-shadow: 0 0 0 4px rgba(3,152,158,0.2); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(0,128,55,0.2); } 50% { box-shadow: 0 0 0 8px rgba(0,128,55,0); } }

/* ---------- Trustbar ---------- */
.trustbar {
    background: var(--bg-soft);
    padding: 1.5rem 0;
    overflow: hidden;
}
.trustbar-label {
    text-align: center;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 0.8rem;
}
.trustbar-logos {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1.2rem 1.8rem;
    flex-wrap: wrap;
}
.trustbar-logos img {
    height: 36px;
    opacity: 0.55;
    filter: grayscale(60%);
    transition: all .35s ease;
    animation: logo-breathe 4s ease-in-out infinite;
}
.trustbar-logos img:nth-child(1) { animation-delay: 0s; }
.trustbar-logos img:nth-child(2) { animation-delay: 0.4s; }
.trustbar-logos img:nth-child(3) { animation-delay: 0.8s; }
.trustbar-logos img:nth-child(4) { animation-delay: 1.2s; }
.trustbar-logos img:nth-child(5) { animation-delay: 0.2s; }
.trustbar-logos img:nth-child(6) { animation-delay: 0.6s; }
.trustbar-logos img:nth-child(7) { animation-delay: 1.0s; }
.trustbar-logos img:nth-child(8) { animation-delay: 1.4s; }
.trustbar-logos img:hover {
    opacity: 1;
    filter: none;
    transform: scale(1.12);
}
@keyframes logo-breathe {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ---------- Secciones ---------- */
.section { padding: 4rem 0; }
.section-light { background: var(--bg-soft); }
.section-dark { background: var(--grad-dark); color: #e2f1f1; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark p { color: #b8d4d4; }
.section-dark .eyebrow { background: rgba(255,255,255,0.08); color: var(--teal-200); }
.section-gradient { background: var(--grad-primary); color: #fff; }
.section-gradient .stat strong { color: #fff; }
.section-gradient .stat span { color: rgba(255,255,255,0.85); }

.section-head { text-align: center; max-width: 760px; margin: 0 auto 2.5rem; }
.section-head h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); color: var(--ink); line-height: 1.2; margin-bottom: 0.8rem; letter-spacing: -0.5px; }
.section-dark .section-head h2 { color: #fff; }
.section-head p { color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.section-dark .section-head p { color: #b8d4d4; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.two-col h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); color: var(--ink); line-height: 1.2; margin-bottom: 1rem; letter-spacing: -0.3px; }
.two-col p { margin-bottom: 0.8rem; font-size: 1rem; line-height: 1.75; }
.two-col > div:first-child p { color: var(--text); }

.solution-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem 1.8rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.solution-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--grad-primary);
}
.solution-card h3 { color: var(--teal-700); margin-bottom: 1rem; font-size: 1.25rem; }
.check-list { list-style: none; margin: 1rem 0; }
.check-list li { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.4rem 0; font-size: 0.95rem; line-height: 1.55; }
.check {
    flex-shrink: 0;
    width: 24px; height: 24px;
    background: var(--teal-50);
    color: var(--teal-600);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
}
.disclaimer-pill {
    margin-top: 1.2rem;
    padding: 0.9rem 1.1rem;
    background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #78350f;
}

/* ---------- Servicios ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}
.service-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    transition: all .25s ease;
}
.service-card:hover { background: rgba(255,255,255,0.07); transform: translateY(-4px); border-color: var(--teal-200); }
.service-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    margin-bottom: 1rem;
}
.service-icon svg { width: 28px; height: 28px; }
.service-icon-tv { background: linear-gradient(135deg, #03989E 0%, #2bb5b9 100%); }
.service-icon-radio { background: linear-gradient(135deg, #008037 0%, #2bb54e 100%); }
.service-icon-api { background: linear-gradient(135deg, #024d50 0%, #03989E 100%); }
.service-card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.service-card p { font-size: 0.95rem; line-height: 1.6; margin-bottom: 1rem; }
.service-link { color: var(--teal-200); font-weight: 600; font-size: 0.9rem; }
.service-link:hover { color: #fff; }

/* ---------- Steps ---------- */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    position: relative;
}
.step {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.3rem;
    position: relative;
    transition: all .25s;
}
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--teal-200); }
.step-num {
    font-size: 2rem;
    font-weight: 800;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
    margin-bottom: 0.6rem;
}
.step h4 { color: var(--ink); margin-bottom: 0.4rem; font-size: 1.05rem; }
.step p { color: var(--muted); font-size: 0.93rem; line-height: 1.55; }

/* ---------- Stats ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    text-align: center;
}
.stat {
    padding: 1.2rem 0.8rem;
    position: relative;
}
.stat::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 3px;
    background: rgba(255,255,255,0.4);
    border-radius: 2px;
}
.stat strong {
    display: block;
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
    background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.85) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stat span {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.92rem;
    font-weight: 500;
    opacity: 0.92;
    letter-spacing: 0.3px;
}

/* ---------- Clientes ---------- */
.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.2rem;
}
.client-tile {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.client-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--grad-primary);
    opacity: 0;
    transition: opacity .3s;
    z-index: 0;
}
.client-tile:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(3,152,158,0.2);
    border-color: var(--teal-500);
}
.client-tile:hover::before { opacity: 0.06; }
.client-tile img { max-height: 60px; max-width: 80%; object-fit: contain; position: relative; z-index: 1; transition: transform .3s; }
.client-tile:hover img { transform: scale(1.1); }

/* ---------- CTA Final ---------- */
.section-cta {
    background: var(--grad-dark);
    color: #e2f1f1;
    text-align: center;
}
.cta-inner { max-width: 720px; margin: 0 auto; }
.section-cta h2 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.2; margin-bottom: 0.8rem; }
.section-cta p { color: #b8d4d4; font-size: 1.1rem; margin-bottom: 2rem; }
.cta-buttons { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.cta-buttons .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.3); }
.cta-buttons .btn-ghost:hover { background: rgba(255,255,255,0.08); }
.cta-links { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.9rem; color: #8fb4b4; }
.cta-links a { color: var(--teal-200); }
.cta-links a:hover { color: #fff; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--dark);
    color: #9ab5b6;
    padding: 2.5rem 0 1.2rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 2rem;
}
.footer-logo { height: 40px; width: auto; margin-bottom: 0.6rem; filter: brightness(0) invert(1); }
.footer-tag { font-size: 0.92rem; max-width: 240px; }
.site-footer h5 { color: #fff; margin-bottom: 0.6rem; font-size: 0.92rem; }
.site-footer a { display: block; color: #9ab5b6; padding: 0.2rem 0; font-size: 0.88rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 1.8rem;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.82rem;
    color: #6b8384;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--grad-hero);
    padding: 1.5rem;
    position: relative;
}
.login-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.4rem 2.2rem;
    width: 100%;
    max-width: 420px;
    margin: auto;
}
.login-logo { text-align: center; margin-bottom: 0.4rem; }
.login-logo img { height: 60px; margin: 0 auto; }
.login-card h1 { text-align: center; font-size: 1.4rem; color: var(--ink); margin-top: 0.6rem; }
.login-subtitle { text-align: center; color: var(--muted); font-size: 0.92rem; margin: 0.4rem 0 1.5rem; }
form label { display: block; margin: 0.9rem 0 0.3rem; font-size: 0.88rem; font-weight: 600; color: var(--ink); }
input, select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
    transition: border-color .15s;
}
input:focus, select:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(3,152,158,0.15); }
.alert { padding: 0.7rem 0.9rem; border-radius: 10px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.login-footer { text-align: center; margin-top: 1.4rem; font-size: 0.88rem; color: var(--muted); }
.login-footer a { color: var(--teal-600); font-weight: 600; }

@media (max-width: 480px) {
    .login-body { padding: 1rem; }
    .login-card { padding: 2rem 1.5rem; border-radius: 12px; }
    .login-logo img { height: 50px; }
    .login-card h1 { font-size: 1.25rem; }
    .login-subtitle { font-size: 0.85rem; margin-bottom: 1.2rem; }
    form label { margin-top: 0.8rem; font-size: 0.85rem; }
    input { padding: 0.7rem 0.85rem; font-size: 1rem; }
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-topnav {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 0.7rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}
.dashboard-brand { display: flex; align-items: center; gap: 0.6rem; }
.dashboard-brand img { height: 34px; }
.dashboard-brand strong { color: var(--ink); font-size: 1rem; }
.dashboard-nav { display: flex; align-items: center; gap: 0.8rem; }
.nav-user { color: var(--muted); font-size: 0.9rem; }
.dashboard-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--ink); }

.toolbar { display: flex; gap: 0.8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar input[type="search"] { flex: 1; min-width: 200px; }

.table-wrapper {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-x: auto;
}
.rules-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.rules-table th, .rules-table td {
    text-align: left;
    padding: 0.75rem 0.95rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
    white-space: nowrap;
}
.rules-table th { background: var(--bg-soft); color: var(--muted); font-weight: 600; cursor: pointer; user-select: none; }
.rules-table td.url-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.empty-cell { text-align: center; color: var(--muted); padding: 2rem; }
.actions-cell { display: flex; gap: 0.4rem; }

.badge {
    display: inline-block;
    padding: 0.18rem 0.6rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-301 { background: var(--teal-50); color: var(--teal-700); }
.badge-302 { background: var(--green-100); color: var(--green-600); }
.badge-exact { background: var(--teal-50); color: var(--teal-700); }
.badge-regex { background: #f4ebff; color: #6941c6; }

/* Badges de tipo de medio */
.badge-media-radio   { background: #e8f0fe; color: #174ea6; }
.badge-media-tv      { background: #fce8e6; color: #c5221f; }
.badge-media-podcast { background: #e6f7e6; color: #1e7e34; }
.badge-media-other   { background: #f3e8fd; color: #7b1fa2; }

.pagination { display: flex; gap: 0.4rem; justify-content: center; margin: 1.2rem 0; flex-wrap: wrap; }
.pagination button { min-width: 2.2rem; }
.pagination .active { background: var(--teal-500); color: #fff; border-color: var(--teal-500); }

/* ---------- Modales ---------- */
.modal {
    position: fixed; inset: 0;
    background: rgba(10,31,33,0.65);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; z-index: 100;
}
.modal[hidden] { display: none; }
.modal-content {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.8rem;
    width: 100%; max-width: 460px;
    max-height: 90vh; overflow-y: auto;
}
.modal-content h2 { font-size: 1.2rem; color: var(--ink); margin-bottom: 0.3rem; }
.modal-content p { margin: 0.6rem 0; color: var(--muted); font-size: 0.92rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.4rem; }

/* ---------- Toast ---------- */
#toast-container {
    position: fixed; bottom: 1.2rem; right: 1.2rem;
    display: flex; flex-direction: column; gap: 0.5rem;
    z-index: 200;
}
.toast {
    padding: 0.75rem 1.1rem;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    animation: toast-in 0.25s ease;
}
.toast-success { background: var(--green-500); }
.toast-error { background: #dc2626; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   DASHBOARD MOBILE
   ============================================================ */
@media (max-width: 900px) {
    .dashboard-topnav { padding: 0.6rem 1rem; }
    .dashboard-brand img { height: 30px; }
    .dashboard-brand strong { font-size: 0.9rem; }
    .container { padding: 0 1rem; }
    .toolbar { flex-direction: column; gap: 0.6rem; }
    .toolbar input[type="search"] { width: 100%; }
    .toolbar .btn { width: 100%; }

    .rules-table { font-size: 0.82rem; }
    .rules-table th, .rules-table td { padding: 0.5rem 0.6rem; }
    .url-cell { max-width: 140px !important; }
    .actions-cell { flex-direction: column; gap: 0.3rem; }
    .actions-cell .btn { width: 100%; padding: 0.4rem 0.6rem; font-size: 0.78rem; }

    .modal-content { padding: 1.4rem 1.2rem; max-width: 95vw; }
    .modal-content h2 { font-size: 1.1rem; }

    /* Toolbar de filtros en tablet */
    .rules-toolbar { flex-wrap: wrap; gap: 0.5rem; }
    .rules-toolbar input[type="search"] { flex: 1 1 200px; min-width: 140px; }
    .rules-toolbar select { flex: 1 1 120px; min-width: 120px; }
    .rules-toolbar #add-btn { flex: 0 0 auto; }
    .rules-toolbar #rules-clear { flex: 0 0 auto; }
}

@media (max-width: 600px) {
    /* Tabla responsive en tarjetas en lugar de filas */
    .container { padding: 0 0.8rem; }
    .table-wrapper { background: transparent; border: none; box-shadow: none; padding: 0; overflow: visible; max-width: 100%; }
    .rules-table { width: 100% !important; max-width: 100% !important; min-width: 0 !important; table-layout: auto; }
    .rules-table thead { display: none; }
    .rules-table tbody, .rules-table tr { display: block; width: 100% !important; min-width: 0 !important; max-width: 100% !important; box-sizing: border-box; }
    .rules-table td { display: flex !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; box-sizing: border-box; }
    .rules-table tbody { padding: 0; }
    .rules-table tr {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 0.9rem 1rem;
        margin-bottom: 0.8rem;
        box-shadow: 0 2px 6px rgba(3,152,158,0.06);
    }
    .rules-table tr:hover { border-color: var(--teal-200); box-shadow: 0 4px 12px rgba(3,152,158,0.10); }
    .rules-table td {
        border: none;
        padding: 0.4rem 0;
        white-space: normal;
        justify-content: space-between;
        align-items: center;
        gap: 0.6rem;
        text-align: right;
    }
    .rules-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        min-width: 90px;
        flex-shrink: 0;
        text-align: left;
    }
    .url-cell {
        word-break: break-all;
        font-family: monospace;
        font-size: 0.85rem;
    }
    .actions-cell {
        flex-direction: row !important;
        justify-content: flex-end !important;
        padding-top: 0.6rem;
        border-top: 1px solid var(--line);
        margin-top: 0.4rem;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet y mediano */
@media (max-width: 900px) {
    .topbar { padding: 0.5rem 0; }
    .topbar-inner { padding: 0.6rem 1rem; flex-wrap: wrap; gap: 0.8rem; }
    .brand span { font-size: 1rem; }
    .brand img { height: 36px; }

    /* Menú hamburguesa */
    .topnav-links { display: none; order: 4; width: 100%; flex-direction: column; gap: 0.5rem; padding: 0.8rem 0 0.5rem; border-top: 1px solid var(--line); margin-top: 0.5rem; }
    .topnav-links.open { display: flex; }
    .topnav-toggle { display: block; }
    .topbar-inner > .btn { order: 3; padding: 0.55rem 1rem; font-size: 0.88rem; }

    .container { padding: 0 1.25rem; }

    .hero { padding: 2.5rem 0 3rem; }
    .hero-grid { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
    .hero-copy { padding-right: 0; }
    .eyebrow { margin-bottom: 1rem; }
    .hero h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); line-height: 1.2; margin-bottom: 1rem; }
    .hero-text { font-size: 1.02rem; line-height: 1.6; margin: 0 auto 1.5rem; max-width: 480px; }
    .hero-cta { justify-content: center; gap: 0.8rem; margin-bottom: 1.5rem; }
    .hero-cta .btn { padding: 0.85rem 1.5rem; font-size: 0.95rem; }
    .hero-bullets { justify-content: center; gap: 0.6rem 1.2rem; font-size: 0.85rem; padding-top: 1rem; }

    .hero-visual { min-height: 320px; flex-direction: column; gap: 0.8rem; }
    .hero-circle { width: 200px; height: 200px; }
    .hero-card-1, .hero-card-2 { position: relative; align-self: center; margin: 0; font-size: 0.78rem; padding: 0.5rem 0.7rem; }
    .hero-card strong { font-size: 0.78rem; }
    .hero-card small { font-size: 0.7rem; }

    .trustbar-logos img { height: 30px; }

    .section { padding: 3rem 0; }
    .section-head { margin-bottom: 2rem; }
    .section-head h2 { font-size: 1.6rem; }
    .section-head p { font-size: 1rem; }

    .two-col { grid-template-columns: 1fr; gap: 1.8rem; }
    .two-col > div { text-align: center; }
    .two-col h2 { font-size: 1.5rem; }

    .services-grid { grid-template-columns: 1fr; gap: 1rem; }
    .service-card { padding: 1.5rem 1.2rem; }

    .feature-visual { grid-template-columns: 1fr; gap: 1.5rem; }
    .feature-visual > div:first-child { text-align: center; }
    .feature-visual-img { max-width: 300px; }

    .steps { grid-template-columns: 1fr; gap: 1rem; }

    .stats { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
    .stat strong { font-size: 2.2rem; }

    .pipeline { gap: 0.4rem; }
    .pipe-step { padding: 1rem 0.9rem; flex: 1 1 calc(50% - 0.5rem); max-width: none; }
    .pipe-arrow { display: none; }
    .pipeline-note { padding: 0.9rem 1rem; font-size: 0.88rem; }

    .client-grid { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
    .client-tile { padding: 1rem; min-height: 90px; }
    .client-tile img { max-height: 45px; }

    .official-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
    .official-card { padding: 1.2rem 1rem; }
    .official-card .off-icon { width: 36px; height: 36px; font-size: 1rem; }
    .official-card h4 { font-size: 0.95rem; }
    .official-card p { font-size: 0.8rem; }

    .cta-buttons { flex-direction: column; }
    .cta-buttons .btn { width: 100%; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .footer-logo { height: 36px; }
}

/* Móvil pequeño */
@media (max-width: 600px) {
    .container { padding: 0 1rem; }

    .hero { padding: 1.8rem 0 2.5rem; }
    .hero h1 { font-size: 1.7rem; line-height: 1.2; }
    .hero-text { font-size: 0.95rem; }
    .hero-bullets { flex-direction: column; align-items: center; gap: 0.3rem; font-size: 0.82rem; }
    .hero-circle { width: 170px; height: 170px; }

    .section { padding: 2.2rem 0; }
    .section-head h2 { font-size: 1.4rem; }
    .section-head p { font-size: 0.92rem; }
    .two-col h2 { font-size: 1.3rem; }

    .stats { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
    .stat strong { font-size: 1.8rem; }
    .stat span { font-size: 0.82rem; }

    .pipe-step { flex: 1 1 100%; }
    .client-grid { grid-template-columns: 1fr 1fr; }
    .official-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.2rem; }

    .timeline { padding-left: 1.5rem; }
    .timeline-item { padding-left: 1.2rem; padding-bottom: 1.2rem; }
    .timeline-item::before { left: -1.2rem; }

    .api-demo-body { font-size: 0.7rem; padding: 0.8rem; min-height: 180px; }
    .api-demo-head { padding: 0.5rem 0.7rem; }
    .api-demo-head small { font-size: 0.65rem; }

    .feature-visual-img { max-width: 260px; }
    .live-pill { font-size: 0.7rem; padding: 0.25rem 0.5rem; }

    .dashboard-nav { display: none; position: absolute; top: 100%; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 0.8rem; border: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
    .dashboard-nav.open { display: flex; }
    .dashboard-toggle { display: block; }
}

/* Móvil muy pequeño */
@media (max-width: 380px) {
    .hero h1 { font-size: 1.5rem; }
    .hero-circle { width: 150px; height: 150px; }
}

/* ============================================================
   EFECTOS DE LANDING
   ============================================================ */

/* Cursor trail SVG cubre toda la página */
#cursor-trail {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.95;
    filter: drop-shadow(0 0 6px rgba(3,152,158,0.35));
}
.cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 10px; height: 10px;
    background: linear-gradient(135deg, #03989E, #008037);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.8), 0 0 16px rgba(3,152,158,0.7);
    transition: opacity .2s, transform .05s linear;
}

/* Ocultar trail en touch y al pasar sobre inputs/select */
@media (hover: none) { #cursor-trail, .cursor-dot { display: none; } }
body:has(input:focus) #cursor-trail,
body:has(textarea:focus) #cursor-trail,
body:has(select:focus) #cursor-trail { opacity: 0.2; }

/* ---------- Reveal on scroll (progresivo: visible por defecto) ---------- */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity .8s ease, transform .8s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Solo se oculta si JS activó el modo reveal */
.js-reveal .reveal {
    opacity: 0;
    transform: translateY(30px);
}
.js-reveal .reveal.reveal-in { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
/* Fallback: si el usuario prefiere menos movimiento, mostrar todo */
@media (prefers-reduced-motion: reduce) {
    .js-reveal .reveal { opacity: 1; transform: none; }
}

/* ---------- Tilt cards ---------- */
[data-tilt] {
    transition: transform .25s ease, box-shadow .25s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

/* ---------- API demo (terminal) ---------- */
.api-demo {
    background: #0a1f21;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(3,152,158,0.25), 0 0 0 1px rgba(3,152,158,0.1);
    font-family: "JetBrains Mono", "Fira Code", "Courier New", monospace;
}
.api-demo-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: #051517;
    border-bottom: 1px solid #0e2a2c;
}
.api-demo-head span { width: 11px; height: 11px; border-radius: 50%; }
.api-demo-head span:nth-child(1) { background: #ff5f57; }
.api-demo-head-head span:nth-child(2) { background: #febc2e; }
.api-demo-head span:nth-child(2) { background: #febc2e; }
.api-demo-head span:nth-child(3) { background: #28c840; }
.api-demo-head small {
    margin-left: auto;
    color: #5b7879;
    font-size: 0.75rem;
    font-family: -apple-system, sans-serif;
}
.api-demo-body {
    padding: 1.2rem 1.2rem 1.4rem;
    color: #c5e8e9;
    font-size: 0.85rem;
    line-height: 1.7;
    min-height: 220px;
    white-space: pre;
    overflow-x: auto;
}
.api-demo-body .demo-out .ln { display: block; }
.api-demo-body .ln-kw  { color: #2bb5b9; }
.api-demo-body .ln-op  { color: #5b7879; }
.api-demo-body .ln-str { color: #d4f0dc; }
.api-demo-cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: #2bb5b9;
    vertical-align: text-bottom;
    animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: "";
    position: absolute;
    left: 0.5rem; top: 0.5rem; bottom: 0.5rem;
    width: 2px;
    background: linear-gradient(180deg, #03989E 0%, #008037 100%);
    border-radius: 2px;
}
.timeline-item {
    position: relative;
    padding: 0 0 1.5rem 1.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: "";
    position: absolute;
    left: -1.5rem;
    top: 0.3rem;
    width: 12px; height: 12px;
    background: #fff;
    border: 3px solid var(--teal-500);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(3,152,158,0.12);
}
.timeline-item h4 { color: var(--ink); margin-bottom: 0.2rem; font-size: 1rem; }
.timeline-item time { color: var(--teal-600); font-weight: 700; font-size: 0.8rem; letter-spacing: 1px; display: block; margin-bottom: 0.2rem; }
.timeline-item p { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

/* ---------- Sección "Sitios oficiales" ---------- */
.official-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}
.official-card {
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.2rem;
    transition: all .25s;
    text-decoration: none;
    color: var(--ink);
    display: block;
}
.official-card:hover {
    border-color: var(--teal-500);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--ink);
}
.official-card .off-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: var(--grad-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 0.7rem;
}
.official-card h4 { font-size: 1rem; margin-bottom: 0.2rem; }
.official-card p { color: var(--muted); font-size: 0.85rem; line-height: 1.45; margin: 0; }
.official-card .off-arrow {
    color: var(--teal-500);
    font-weight: 700;
    margin-top: 0.6rem;
    display: inline-block;
    font-size: 0.9rem;
}

/* ---------- "Lo que entregamos" (visual) ---------- */
.feature-visual {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: center;
}
.feature-visual-img {
    background: var(--grad-primary);
    border-radius: var(--radius);
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
    max-width: 360px;
    margin: 0 auto;
}
.feature-visual-img::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0,0,0,0.18), transparent 50%);
}
.feature-visual-img img { position: relative; filter: drop-shadow(0 14px 30px rgba(0,0,0,0.3)); border-radius: 10px; width: 100%; }
.feature-visual-img .live-pill {
    position: absolute;
    top: 1rem; right: 1rem;
    background: rgba(0,0,0,0.55);
    color: #fff;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex; align-items: center; gap: 0.4rem;
    backdrop-filter: blur(8px);
}
.feature-visual-img .live-pill .live-dot {
    width: 8px; height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse-live 1.5s infinite;
}
@keyframes pulse-live {
    0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.7); }
    50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

/* ---------- Mejoras del hero ---------- */
.hero-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(255,255,255,0.7);
    color: var(--teal-700);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.2rem;
    backdrop-filter: blur(6px);
}
.hero-tag-pill .pulse {
    width: 8px; height: 8px;
    background: var(--green-500);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(0,128,55,0.2);
    animation: pulse-live 1.6s infinite;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .feature-visual { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .api-demo-body { font-size: 0.78rem; }
}

/* ---------- Modal de logout (centrado y profesional) ---------- */
.modal-centered { text-align: center; max-width: 400px; }
.logout-icon {
    width: 64px; height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #e6f7f7, #d4f0dc);
    color: var(--teal-600);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    animation: pulse-icon 2s ease-in-out infinite;
}
.logout-icon svg { width: 30px; height: 30px; }
@keyframes pulse-icon {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(3,152,158,0.2); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(3,152,158,0); }
}
.modal-centered h2 { font-size: 1.3rem; }
.logout-stats {
    margin: 1.2rem 0;
    padding: 0.8rem;
    background: var(--bg-soft);
    border-radius: 10px;
    display: flex; justify-content: center; gap: 2rem;
}
.logout-stats div { text-align: center; }
.logout-stats strong {
    display: block;
    font-size: 1.6rem;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
    line-height: 1;
}
.logout-stats span { color: var(--muted); font-size: 0.85rem; }
.modal-actions-center { justify-content: center; }

/* ---------- Pipeline de captura/codificación ---------- */
.pipeline {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.pipe-step {
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.1rem;
    text-align: left;
    flex: 1 1 170px;
    max-width: 220px;
    transition: all .25s ease;
    position: relative;
}
.pipe-step:hover {
    border-color: var(--teal-500);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(3,152,158,0.15);
}
.pipe-num {
    display: inline-block;
    background: var(--grad-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}
.pipe-step h4 {
    color: var(--ink);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}
.pipe-step p {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}
.pipe-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    align-self: center;
    padding: 0 0.3rem;
    animation: arrow-pulse 2s ease-in-out infinite;
}
@keyframes arrow-pulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}
.pipeline-note {
    background: var(--bg-soft);
    border-left: 4px solid var(--teal-500);
    border-radius: 10px;
    padding: 1.1rem 1.3rem;
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.6;
}
@media (max-width: 720px) {
    .pipe-arrow { transform: rotate(90deg); }
    @keyframes arrow-pulse {
        0%, 100% { transform: rotate(90deg) translateX(0); }
        50% { transform: rotate(90deg) translateX(4px); }
    }
}

/* ============================================================
   FAB (Floating Action Button) - Zona del pulgar móvil
   Solo visible en móvil/tablet
   ============================================================ */
.fab {
    display: none;
    position: fixed;
    right: 1.2rem;
    bottom: 1.5rem;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #03989E 0%, #008037 100%);
    color: #fff;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(3,152,158,0.45), 0 2px 6px rgba(0,0,0,0.2);
    transition: transform .2s ease, box-shadow .2s ease;
    -webkit-tap-highlight-color: transparent;
    align-items: center;
    justify-content: center;
}
.fab:active { transform: scale(0.94); }
.fab.active {
    background: var(--ink);
    box-shadow: 0 8px 24px rgba(10,31,33,0.4), 0 2px 6px rgba(0,0,0,0.2);
}
.fab-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .2s ease, transform .25s ease;
}
.fab-icon svg { width: 26px; height: 26px; }
.fab-icon-close { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.fab.active .fab-icon-menu { opacity: 0; transform: rotate(90deg) scale(0.5); }
.fab.active .fab-icon-close { opacity: 1; transform: rotate(0) scale(1); }

.fab-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 31, 33, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    animation: fab-fade .25s ease;
}
.fab-backdrop[hidden] { display: none; }
@keyframes fab-fade { from { opacity: 0; } to { opacity: 1; } }

.fab-panel {
    position: fixed;
    right: 1.2rem;
    bottom: 5.5rem;
    width: calc(100vw - 2.4rem);
    max-width: 320px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25), 0 0 0 1px rgba(3,152,158,0.15);
    padding: 1rem;
    z-index: 999;
    animation: fab-slide-up .3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
}
.fab-panel[hidden] { display: none; }
@keyframes fab-slide-up {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.fab-panel-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem 0.8rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.5rem;
}
.fab-logo { height: 32px; width: auto; }
.fab-panel-head strong { color: var(--ink); font-size: 0.95rem; }

.fab-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.8rem;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 10px;
    transition: background .15s;
    text-decoration: none;
}
.fab-link:hover, .fab-link:active { background: var(--bg-soft); text-decoration: none; color: var(--ink); }
.fab-link svg { flex-shrink: 0; color: var(--teal-600); }
.fab-divider { height: 1px; background: var(--line); margin: 0.4rem 0.6rem; }
.fab-cta {
    background: var(--grad-primary);
    color: #fff !important;
    font-weight: 700;
    justify-content: center;
}
.fab-cta:hover, .fab-cta:active { background: var(--grad-primary) !important; opacity: 0.9; }
.fab-whatsapp { color: var(--green-600); }
.fab-whatsapp svg { color: var(--green-500); }

/* Mostrar FAB solo en móvil/tablet */
@media (max-width: 900px) {
    .fab { display: flex; }
    /* Asegurar que el contenido del FAB no choque con el toast en el dashboard */
    body { padding-bottom: 5rem; }
}

@media (min-width: 901px) {
    .fab, .fab-panel, .fab-backdrop { display: none !important; }
}
