/* ===== Base compartida: tipografía, variables, botones, formularios, tarjetas ===== */
@font-face {
    font-family: "Nunito";
    src: url("../fonts/nunito-latin-wght-normal.woff2") format("woff2");
    font-weight: 200 1000; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Fraunces";
    src: url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Fraunces";
    src: url("../fonts/fraunces-latin-wght-italic.woff2") format("woff2");
    font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
    /* Marca (tomada del logotipo) */
    --navy: #0f2a5c;
    --navy-dark: #081a3d;
    --navy-soft: #1c3d7a;
    --blue: #2b7bc4;
    --blue-soft: #8dc0ec;
    --blue-tint: #e9f3fc;
    --sun: #f4b942;            /* acento cálido */
    --sun-dark: #d9992a;
    --sun-tint: #fff4d9;
    --brown: #8a5a3b;
    --coral: #e4684f;
    --leaf: #1f8a5b;

    /* Neutros */
    --white: #ffffff;
    --paper: #fbf9f5;
    --gray-50: #f6f7fa;
    --gray-100: #eceff5;
    --gray-300: #d6dce8;
    --gray-600: #5a6578;
    --text: #1b2434;
    --ok: #1f7a4d;
    --danger: #b3261e;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(15, 42, 92, .06), 0 2px 6px rgba(15, 42, 92, .05);
    --shadow: 0 2px 4px rgba(15, 42, 92, .05), 0 10px 24px rgba(15, 42, 92, .08);
    --shadow-lg: 0 4px 8px rgba(15, 42, 92, .06), 0 24px 48px rgba(15, 42, 92, .14);

    --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.65; color: var(--text); background: var(--white); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 .6rem; font-weight: 800; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1rem; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--sun); color: var(--navy-dark); }

.container { width: min(1140px, 100% - 2.5rem); margin-inline: auto; }
.container.narrow, .narrow { max-width: 780px; margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--gray-600); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Botones */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .7rem 1.3rem; border-radius: 999px; border: 2px solid transparent;
    font: inherit; font-weight: 700; font-size: .98rem; text-decoration: none; cursor: pointer; line-height: 1.2;
    transition: background-color .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: var(--white); box-shadow: 0 6px 16px rgba(15, 42, 92, .22); }
.btn-primary:hover { background: var(--navy-soft); color: var(--white); box-shadow: 0 8px 20px rgba(15, 42, 92, .28); }
.btn-sun { background: var(--sun); color: var(--navy-dark); box-shadow: 0 6px 16px rgba(244, 185, 66, .35); }
.btn-sun:hover { background: #ffc85c; color: var(--navy-dark); }
.btn-outline { background: var(--white); color: var(--navy); border-color: var(--gray-300); }
.btn-outline:hover { background: var(--blue-tint); border-color: var(--blue-soft); color: var(--navy); }
.btn-light { background: rgba(255, 255, 255, .12); color: var(--white); border-color: rgba(255, 255, 255, .4); }
.btn-light:hover { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn-danger { background: var(--white); color: var(--danger); border-color: #e9bdb9; }
.btn-danger:hover { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-sm { padding: .38rem .85rem; font-size: .86rem; border-width: 1.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Formularios */
.form .field { margin-bottom: 1.1rem; }
.form label, .field label { display: block; font-weight: 700; margin-bottom: .3rem; font-size: .95rem; color: var(--navy); }
.form label.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=file], select, textarea {
    width: 100%; padding: .65rem .85rem; font: inherit; font-size: 1rem; color: var(--text);
    background: var(--white); border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px var(--blue-tint); }
textarea { resize: vertical; min-height: 5rem; }
input[type=checkbox] { width: 1.15rem; height: 1.15rem; accent-color: var(--navy); }
.help { display: block; margin-top: .25rem; color: var(--gray-600); font-size: .85rem; }
.error-text { display: block; margin-top: .25rem; color: var(--danger); font-size: .875rem; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.form-grid { display: grid; gap: 0 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .75rem; }
.form-narrow { max-width: 520px; }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
legend { font-weight: 800; color: var(--navy); font-size: 1.15rem; padding: 0; margin-bottom: .85rem; }

/* Tarjetas y avisos */
.card { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-sm); }
.alert { padding: .85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid; }
.alert ul { margin: .35rem 0 0 1.1rem; padding: 0; }
.alert-success { background: #e9f6ef; border-color: #b7dfc7; color: #14532d; }
.alert-danger { background: #fdeceb; border-color: #f0c4c1; color: #7f1d1a; }
.badge { display: inline-block; padding: .15rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-ok { background: #e1f3ea; color: #14633d; }
.badge-off { background: var(--gray-100); color: var(--gray-600); }
.badge-info { background: var(--blue-tint); color: var(--navy); }
.code { background: var(--navy-dark); color: #e8eef9; padding: .8rem 1rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: .875rem; white-space: pre-wrap; word-break: break-word; }
.pendiente { padding: .85rem 1.1rem; border: 1.5px dashed var(--gray-300); border-radius: var(--radius-sm); background: var(--gray-50); color: var(--gray-600); font-style: italic; }

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