/* =========================================================================
   GLOBAL SECTION: Components
   ========================================================================= */

/* =========================================================================
   CITEM web — Formularios y piezas compartidas por las páginas
   -------------------------------------------------------------------------
   Los botones, chips, estados, campos y tarjetas del sistema son los `cds-*`
   de componentes-ds.css. Aquí van las piezas de la web que no son del
   sistema: el campo de los formularios de captación, la microcopia y los
   patrones de cabecera de página.
   ========================================================================= */

/* --- Campos (DS §5.5) --- */
.form-group {
    margin-bottom: 1.5rem;
}

/* SYNC DS §5.5: etiqueta en Gobold y versalitas, encima del campo. */
label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: var(--tracking-ui);
    color: var(--c-text-heading);
    margin-bottom: var(--space-sm);
}

/* SYNC DS §5.5: borde de 2 px de tinta maciza y valor en Helvetica a 16 px
   o más. El foco es el outline de base.css: el campo no lo apaga. */
input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    min-height: 44px;
    padding: var(--space-md);
    font-family: var(--font-body);
    font-size: 1.125rem;
    color: var(--c-text-strong);
    background-color: var(--c-surface);
    border: var(--border-w-interactive) solid var(--c-ink);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--c-coral);
}

/* --- Badges / Labels --- */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    /* SYNC DS §3.1: fondo con texto pequeño, Coral oscuro (5,38:1). */
    background-color: var(--c-coral-dark);
    color: var(--c-paper);
    letter-spacing: var(--tracking-ui);
}

/* SYNC DS §3.1: texto secundario en el nivel `muted`, sin opacidades sueltas. */
.microcopy {
    display: block;
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--c-text-muted);
    margin-top: 0.75rem;
}

/* =========================================================================
   GLOBAL SECTION: Shared Page Patterns
   ========================================================================= */

/* SYNC DS §3.3: page heroes share one global implementation; pages only own copy/structure. */
.formaciones-header {
    background-color: var(--c-indigo);
    color: var(--c-paper);
    min-height: 50vh;
    display: flex;
    align-items: flex-end;
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    border-bottom: var(--border-w-accent) solid var(--c-coral);
}

.formaciones-kicker {
    font-size: 1rem;
    font-weight: 900;
    color: var(--c-paper);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: var(--spacing-sm);
    /* SYNC DS §3.1: secundario sobre oscuro, Papel al 70 %, sin opacidad suelta. */
    color: var(--c-text-muted-inverse);
}

.formaciones-header h1 {
    font-size: var(--text-hero);
    font-weight: 900;
    color: var(--c-paper);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: var(--tracking-display);
    line-height: var(--leading-display);
}

.formaciones-header .subtitle {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    color: var(--c-coral);
    max-width: 700px;
    line-height: 1.2;
}

/* SYNC DS §5.3: CTA forms are global; page CSS must not reimplement form layout. */
.cta-form {
    max-width: 600px;
    margin: var(--spacing-md) auto var(--spacing-md);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.cta-form .form-group {
    margin-bottom: 0;
}

/* El botón de un formulario de captación es un `cds-boton`; aquí solo ocupa
   el ancho del formulario. */
.cta-submit-btn {
    width: 100%;
    margin-top: var(--spacing-sm);
}

@media (max-width: 768px) {
    .formaciones-header {
        min-height: 40vh;
        padding: var(--spacing-lg) 0 var(--spacing-md);
    }

    .formaciones-kicker {
        letter-spacing: 0.5px;
        font-size: 0.75rem;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* =========================================================================
   GLOBAL SECTION: Icon Glyphs
   ========================================================================= */

/* =========================================================================
   CITEM — SVG Icon System (Phosphor Bold, self-hosted sprite)
   
   Gold standard: <symbol>/<use> pattern with external sprite file.
   - Renders instantly (no font loading delay / FOUC)
   - Only the icons a page uses (vs ~40KB webfont)
   - fill="currentColor" inherits text color from parent
   - Accessible: aria-hidden="true" on decorative icons
   - Zero external dependencies (no CDN)
   
   Usage:
     <svg class="icon" aria-hidden="true">
       <use href="/assets/icons/sprite.svg#brain"></use>
     </svg>
   ========================================================================= */

.icon {
    width: 1em;
    height: 1em;
    fill: currentColor;
    display: inline-block;
    vertical-align: -0.125em;   /* optical alignment with text */
    flex-shrink: 0;
}


/* =========================================================================
   Preguntas plegables: siempre un <details> nativo
   -------------------------------------------------------------------------
   Abre sin JS, con teclado y con la búsqueda del navegador, y no hay estado
   que pintar a mano. Lo usan /precio/ (`.pr-detail`) y /castradar/
   (`.casting-faq-item`); cada página pone su tipografía y su caja, y aquí
   vive lo común: la fila pulsable y el marcador. El marcador son dos barras
   Coral y la vertical se retira al abrir: el triángulo nativo es un glifo, y
   el manual no los quiere como icono (§3.4).
   ========================================================================= */

summary {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    min-height: 44px;
    cursor: pointer;
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: "";
    flex: 0 0 12px;
    height: 12px;
    margin-top: 3px;
    background-image:
        linear-gradient(var(--c-coral), var(--c-coral)),
        linear-gradient(var(--c-coral), var(--c-coral));
    background-size: 12px 2px, 2px 12px;
    background-position: center;
    background-repeat: no-repeat;
}

details[open] > summary::after {
    background-size: 12px 2px, 0 0;
}
