/*
 * tdc-base.css  —  Tarjetas Digitales Chile (tema dark / NFC)
 * ------------------------------------------------------------
 * Fundaciones del SITIO PÚBLICO: design tokens, reset, tipografía,
 * botones, formularios, alertas, container y páginas CMS/404.
 *
 * IMPORTANTE: este tema es SOLO para el front (lo carga lib/layout.php).
 * El admin sigue usando base.css + components.css + admin.css (tema claro).
 * No hay choque porque admin y público cargan archivos distintos.
 *
 * El único "knob" de marca es el par de acentos --a1 / --a2 (abajo).
 * Cambiarlos retematiza todo el sitio.
 * ------------------------------------------------------------
 */

:root {
    /* ====== Acento de marca (paleta "Esmeralda" del diseño) ====== */
    --a1: #15e08a;            /* acento principal (neón) */
    --a2: #06b6a4;            /* acento secundario (gradientes) */

    /* ====== Fondos / superficies ====== */
    --tdc-bg:        #06070f;
    --tdc-surface:   #0a0f1f;
    --tdc-surface-2: #0d1426;
    --tdc-surface-3: #070b18;

    /* ====== Texto ====== */
    --tdc-ink:     #eaf0ff;
    --tdc-muted:   #a8b2cf;
    --tdc-muted-2: #8a96b5;
    --tdc-muted-3: #6b7796;
    --tdc-faint:   #5f6b88;

    /* ====== Líneas / bordes (sobre fondo oscuro) ====== */
    --tdc-line:        rgba(255, 255, 255, .09);
    --tdc-line-soft:   rgba(255, 255, 255, .06);
    --tdc-line-strong: rgba(255, 255, 255, .14);

    /* ====== Tipografía ====== */
    --tdc-font:    "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --tdc-display: "Space Grotesk", var(--tdc-font);
    --tdc-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

    /* ====== Layout ====== */
    --tdc-max: 1200px;
}

/* ==========================================================
   Reset mínimo
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--tdc-bg);
    color: var(--tdc-ink);
    font-family: var(--tdc-font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, video, svg { max-width: 100%; height: auto; display: block; }

::selection { background: var(--a1); color: var(--tdc-bg); }

a { color: var(--a1); text-decoration: none; }
a:hover { color: var(--tdc-ink); }

/* ==========================================================
   Tipografía base
   ========================================================== */
h1, h2, h3, h4 {
    font-family: var(--tdc-display);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.1;
    margin: 0 0 .6em;
    color: var(--tdc-ink);
}

p { margin: 0 0 1em; }

/* Etiqueta tipo "mono" usada como eyebrow de sección (— PRODUCTOS NFC) */
.tdc-eyebrow {
    font-family: var(--tdc-mono);
    font-size: 12px;
    letter-spacing: .14em;
    color: var(--a1);
    text-transform: none;
    margin: 0;
}

/* Texto con gradiente de acento (para palabras destacadas en titulares) */
.tdc-grad {
    background: linear-gradient(120deg, var(--a1), var(--a2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ==========================================================
   Container
   ========================================================== */
.tdc-container,
.container {
    max-width: var(--tdc-max);
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 640px) {
    .tdc-container,
    .container { padding: 0 20px; }
}

/* ==========================================================
   Botones
   ========================================================== */
.tdc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-family: var(--tdc-font);
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    padding: 15px 26px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s, background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.tdc-btn:active { transform: translateY(1px); }

/* Primario: relleno de acento con glow */
.tdc-btn--primary {
    background: var(--a1);
    color: var(--tdc-bg);
    box-shadow: 0 0 30px color-mix(in srgb, var(--a1) 50%, transparent);
}
.tdc-btn--primary:hover {
    color: var(--tdc-bg);
    box-shadow: 0 0 42px color-mix(in srgb, var(--a1) 65%, transparent);
    transform: translateY(-2px);
}

/* Secundario: vidrio sobre oscuro */
.tdc-btn--ghost {
    background: rgba(255, 255, 255, .05);
    color: var(--tdc-ink);
    border-color: var(--tdc-line-strong);
    font-weight: 600;
}
.tdc-btn--ghost:hover {
    background: rgba(255, 255, 255, .1);
    color: var(--tdc-ink);
}

/* Sólido oscuro (sobre fondo de acento, ej. CTA de producto) */
.tdc-btn--dark {
    background: var(--tdc-bg);
    color: #fff;
}
.tdc-btn--dark:hover { color: #fff; transform: translateY(-2px); }

.tdc-btn--sm { padding: 11px 20px; font-size: 14px; border-radius: 999px; }
.tdc-btn--block { width: 100%; }

/* ==========================================================
   Badge / pill (badge de sección "TECNOLOGÍA NFC · CHILE")
   ========================================================== */
.tdc-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--tdc-mono);
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--a1);
    border: 1px solid color-mix(in srgb, var(--a1) 30%, transparent);
    background: color-mix(in srgb, var(--a1) 6%, transparent);
    padding: 7px 14px;
    border-radius: 999px;
}
.tdc-pill__dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--a1);
    box-shadow: 0 0 10px var(--a1);
}

/* ==========================================================
   Formularios (lead form en sección contacto)
   ========================================================== */
.lead-form { margin: 0; }

.lead-form__field { margin: 0 0 16px; }

.lead-form__field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--tdc-muted);
    margin-bottom: 6px;
}

.lead-form input[type="text"],
.lead-form input[type="email"],
.lead-form input[type="tel"],
.lead-form input,
.lead-form textarea {
    width: 100%;
    padding: 13px 15px;
    font-family: inherit;
    font-size: 15px;
    color: var(--tdc-ink);
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--tdc-line-strong);
    border-radius: 11px;
    transition: border-color .15s, box-shadow .15s, background .15s;
    appearance: none;
}
.lead-form textarea { min-height: 120px; resize: vertical; line-height: 1.5; }

.lead-form input::placeholder,
.lead-form textarea::placeholder { color: var(--tdc-faint); }

.lead-form input:focus,
.lead-form textarea:focus {
    outline: none;
    border-color: var(--a1);
    background: rgba(255, 255, 255, .06);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--a1) 18%, transparent);
}

.lead-form__submit { margin: 22px 0 0; }

/* Botón del lead form: usa .btn por compatibilidad con el componente. */
.lead-form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-family: var(--tdc-font);
    font-weight: 700;
    font-size: 15px;
    padding: 15px 26px;
    border: none;
    border-radius: 12px;
    background: var(--a1);
    color: var(--tdc-bg);
    cursor: pointer;
    box-shadow: 0 0 30px color-mix(in srgb, var(--a1) 45%, transparent);
    transition: transform .15s, box-shadow .15s;
}
.lead-form .btn:hover { transform: translateY(-2px); box-shadow: 0 0 42px color-mix(in srgb, var(--a1) 60%, transparent); }

/* ==========================================================
   Alertas (mensajes del form de contacto)
   ========================================================== */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--tdc-line);
    background: rgba(255, 255, 255, .04);
    color: var(--tdc-ink);
    margin: 0 0 18px;
    font-size: 14.5px;
    line-height: 1.5;
}
.alert--success {
    border-color: color-mix(in srgb, var(--a1) 45%, transparent);
    background: color-mix(in srgb, var(--a1) 10%, transparent);
    color: var(--tdc-ink);
}
.alert--error {
    border-color: rgba(255, 120, 120, .45);
    background: rgba(255, 80, 80, .1);
    color: #ffd7d7;
}

/* ==========================================================
   Páginas CMS (/terminos, /privacidad, /gracias) y artículos
   ========================================================== */
main.container,
.container > .page { padding-top: 60px; }

.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 60px 0 90px;
    color: var(--tdc-muted);
    font-size: 16px;
    line-height: 1.7;
}
.page h1 { font-size: clamp(2rem, 5vw, 3rem); color: var(--tdc-ink); margin-bottom: .4em; }
.page h2 { font-size: 1.5rem; color: var(--tdc-ink); margin: 1.6em 0 .5em; }
.page h3 { font-size: 1.2rem; color: var(--tdc-ink); margin: 1.4em 0 .5em; }
.page p { margin: 0 0 1.1em; }
.page a { color: var(--a1); text-decoration: underline; text-underline-offset: .2em; }
.page ul, .page ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.page li { margin-bottom: .4em; }
.page img { border-radius: 14px; margin: 1.2em 0; }
.page blockquote {
    margin: 1.4em 0; padding: .2em 0 .2em 1.2em;
    border-left: 3px solid var(--a1); color: var(--tdc-ink);
}

/* Post de blog */
.page__eyebrow { font-family: var(--tdc-mono); font-size: 13px; margin: 0 0 1em; }
.page__eyebrow a { color: var(--a1); }
.page__date { font-family: var(--tdc-mono); font-size: 13px; color: var(--tdc-muted-3); margin: -.3em 0 1.6em; }
.page__cta { margin-top: 2.4em; }

/* ==========================================================
   Página de error (404)
   ========================================================== */
.error-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 120px 20px;
    text-align: center;
}
.error-page__code {
    font-family: var(--tdc-display);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--tdc-ink);
    margin: 0 0 .3em;
}
.error-page__text { font-size: 1.1rem; color: var(--tdc-muted); margin: 0 0 1.6em; }

/* ==========================================================
   Animaciones (NFC rings, float, pulse, marquee)
   ========================================================== */
@keyframes tdc-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes tdc-pulse { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes tdc-ring  { 0% { transform: translate(-50%, -50%) scale(.6); opacity: .9; } 100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; } }
@keyframes tdc-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

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