/* =====================================================================
   DAGNA — BASE + COMPONENTES
   Depende de tokens.css. Componentes reutilizables en cualquier página.
   ===================================================================== */

/* ---------------------------------------------------------------------
   RESET / BASE
   --------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h-compact) + var(--space-4));
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    font-weight: var(--fw-regular);
    line-height: var(--lh-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: 0;
}

ul[role="list"],
ol[role="list"] {
    list-style: none;
}

::selection {
    background: var(--mint-100);
    color: var(--plum-950);
}

/* Foco visible y consistente (accesibilidad) */
:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
    border-radius: 4px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    z-index: var(--z-float);
    padding: var(--space-3) var(--space-5);
    background: var(--plum-800);
    color: var(--cream);
    border-radius: var(--radius-pill);
    font-weight: var(--fw-semibold);
    transform: translateY(-200%);
    transition: transform var(--dur-base) var(--ease-out);
}

.skip-link:focus {
    transform: translateY(0);
}

/* ---------------------------------------------------------------------
   LAYOUT
   --------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container--narrow {
    max-width: calc(var(--container-narrow) + var(--gutter) * 2);
}

.section {
    padding-block: var(--section-y);
    position: relative;
}

.section--alt   { background: var(--color-surface-alt); }
.section--dark  { background: var(--gradient-plum); color: var(--color-text-inverse); }
.section--brand { background: var(--gradient-signature); color: var(--white); }

/* Encabezado de sección: eyebrow + título + bajada */
.section-head {
    display: grid;
    gap: var(--space-5);
    margin-bottom: clamp(var(--space-7), 5vw, var(--space-9));
}

.section-head--split {
    grid-template-columns: 1fr;
    align-items: end;
}

@media (min-width: 900px) {
    .section-head--split {
        grid-template-columns: 1.1fr 0.9fr;
        gap: var(--space-8);
    }
}

.section-head--center {
    text-align: center;
    justify-items: center;
}

/* ---------------------------------------------------------------------
   TIPOGRAFÍA
   --------------------------------------------------------------------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--color-accent-text);
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.eyebrow--light { color: var(--mint-500); }
.eyebrow--on-brand { color: var(--white); }

.display,
.h1,
.h2,
.h3 {
    font-weight: var(--fw-semibold);
    color: var(--color-heading);
    letter-spacing: var(--ls-tight);
    text-wrap: balance;
}

.display { font-size: var(--fs-display); line-height: var(--lh-tight); }
.h1      { font-size: var(--fs-h1);      line-height: var(--lh-tight); }
.h2      { font-size: var(--fs-h2);      line-height: var(--lh-snug); }
.h3      { font-size: var(--fs-h3);      line-height: var(--lh-snug); }

.h2 em,
.display em {
    font-style: normal;
    font-weight: var(--fw-light);
}

.lead {
    font-size: var(--fs-lead);
    line-height: 1.6;
    color: var(--color-text-muted);
    max-width: 60ch;
    text-wrap: pretty;
}

.text-inverse,
.text-inverse .h2,
.text-inverse .h3 { color: var(--white); }
.text-inverse .lead { color: rgba(254, 252, 245, 0.82); }

/* ---------------------------------------------------------------------
   BOTONES
   .btn                 base
   .btn--primary        menta (acción principal, 1 por vista)
   .btn--secondary      contorno ciruela
   .btn--ghost-light    contorno claro sobre fondos oscuros/foto
   .btn--sm / --lg      tamaños
   .btn__icon           flecha que se desliza al hover
   --------------------------------------------------------------------- */
.btn {
    --btn-bg: transparent;
    --btn-fg: var(--plum-800);
    --btn-border: transparent;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    min-height: 48px;
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 0.9375rem;
    font-weight: var(--fw-semibold);
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition:
        background-color var(--dur-base) var(--ease-out),
        color var(--dur-base) var(--ease-out),
        border-color var(--dur-base) var(--ease-out),
        box-shadow var(--dur-base) var(--ease-out),
        transform var(--dur-base) var(--ease-out);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn__icon {
    display: inline-grid;
    place-items: center;
    font-size: 1.05em;
    transition: transform var(--dur-base) var(--ease-out);
}

.btn:hover .btn__icon { transform: translateX(4px); }

.btn--primary {
    --btn-bg: var(--color-accent);
    --btn-fg: var(--color-on-accent);
}

.btn--primary:hover {
    --btn-bg: var(--color-accent-hover);
    box-shadow: var(--shadow-accent);
}

.btn--secondary {
    --btn-border: var(--plum-800);
    --btn-fg: var(--plum-800);
}

.btn--secondary:hover {
    --btn-bg: var(--plum-800);
    --btn-fg: var(--cream);
}

.btn--ghost-light {
    --btn-border: rgba(254, 252, 245, 0.55);
    --btn-fg: var(--cream);
    backdrop-filter: blur(6px);
}

.btn--ghost-light:hover {
    --btn-bg: var(--cream);
    --btn-fg: var(--plum-800);
    --btn-border: var(--cream);
}

.btn--sm { min-height: 40px; padding: 0.6rem 1.15rem; font-size: var(--fs-small); }
.btn--lg { min-height: 56px; padding: 1rem 2rem; font-size: 1rem; }
.btn--block { width: 100%; }

.btn[disabled],
.btn[aria-busy="true"] {
    opacity: 0.6;
    pointer-events: none;
}

/* Botón circular de ícono (flechas de carrusel, etc.) */
.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1.5px solid rgba(254, 252, 245, 0.45);
    color: var(--cream);
    font-size: 1.15rem;
    transition: background-color var(--dur-base) var(--ease-out),
                color var(--dur-base) var(--ease-out),
                border-color var(--dur-base) var(--ease-out);
}

.icon-btn:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-on-accent);
}

/* Enlace con flecha */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-small);
    color: var(--color-accent-text);
}

.link-arrow i { transition: transform var(--dur-base) var(--ease-out); }
.link-arrow:hover i { transform: translateX(4px); }

/* ---------------------------------------------------------------------
   ÍCONO EN CÍRCULO
   --------------------------------------------------------------------- */
.icon-badge {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--mint-100);
    color: var(--plum-800);
    font-size: 1.3rem;
}

.icon-badge--dark {
    background: rgba(95, 218, 179, 0.14);
    color: var(--mint-500);
}

/* ---------------------------------------------------------------------
   TARJETA BASE
   --------------------------------------------------------------------- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------------------------
   FORMULARIOS
   --------------------------------------------------------------------- */
.field {
    display: grid;
    gap: var(--space-2);
}

.field__label {
    font-size: var(--fs-small);
    font-weight: var(--fw-medium);
    color: var(--color-text);
}

.field__label .optional {
    font-weight: var(--fw-regular);
    color: var(--color-text-muted);
}

.field__control {
    width: 100%;
    min-height: 52px;
    padding: 0.85rem 1rem;
    background: var(--cream);
    border: 1.5px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.9375rem;
    transition: border-color var(--dur-base) var(--ease-out),
                box-shadow var(--dur-base) var(--ease-out),
                background-color var(--dur-base) var(--ease-out);
    appearance: none;
}

.field__control::placeholder { color: #9C8A92; }

.field__control:hover { border-color: var(--plum-600); }

.field__control:focus {
    outline: none;
    background: var(--white);
    border-color: var(--mint-600);
    box-shadow: 0 0 0 4px rgba(95, 218, 179, 0.25);
}

.field__control:user-invalid {
    border-color: var(--color-error);
}

select.field__control {
    padding-right: 2.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236A394E' viewBox='0 0 16 16'%3E%3Cpath d='M1.6 5.1a.75.75 0 0 1 1.06 0L8 10.44l5.34-5.34a.75.75 0 1 1 1.06 1.06l-5.87 5.87a.75.75 0 0 1-1.06 0L1.6 6.16a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
}

textarea.field__control {
    min-height: 132px;
    resize: vertical;
}

.form-status {
    display: none;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    font-size: var(--fs-small);
    font-weight: var(--fw-medium);
}

.form-status.is-visible { display: flex; }
.form-status--success { background: var(--mint-100); color: var(--plum-950); }
.form-status--error   { background: #FCE8E6; color: var(--color-error); }

/* ---------------------------------------------------------------------
   REVEAL AL SCROLL (solo si hay JS; sin JS todo se ve)
   --------------------------------------------------------------------- */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity var(--dur-slow) var(--ease-out),
                transform var(--dur-slow) var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .js [data-reveal] { opacity: 1; transform: none; }
}
