/* Portal de resultados FDHCC, con la identidad del sitio oficial (fundaciondamashcc.org.ec):
   cabecera en degradado 135deg #00224f -> #043353 -> blanco, menu sobre #043353, titulos en
   Roboto, botones #0067c7 en Montserrat, fondo #f5f5f5 y pie #043353. Fuentes locales. */
@font-face { font-family: Roboto; font-weight: 100 900; font-display: swap; src: url(fonts/roboto-latin.woff2) format("woff2"); }
@font-face { font-family: Montserrat; font-weight: 100 900; font-display: swap; src: url(fonts/montserrat-latin.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --fd-navy-900: #00224f; --fd-navy: #043353; --fd-sky: #6ec1e4;
  --fd-blue: #0067c7; --fd-blue-hover: #00539f; --fd-blue-soft: rgba(0, 103, 199, .12);
  --fd-bg: #f5f5f5; --fd-surface: #ffffff; --fd-line: #dde2e8; --fd-line-strong: #b8c2cd;
  --fd-text: #4b4f58; --fd-muted: #6b7079;
  --fd-bad: #a61b1b; --fd-bad-bg: #fdeeee; --fd-bad-line: #f5c9c9;
  --fd-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  color: var(--fd-text); font-family: var(--fd-sans); font-size: 15px; line-height: 1.6; background: var(--fd-bg);
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--fd-blue); outline-offset: 2px; }

/* ---------- Cabecera (sitio oficial) ---------- */
.fd-header { flex: none; background: linear-gradient(135deg, var(--fd-navy-900) 0%, var(--fd-navy) 41%, #fff 100%); }
.fd-header__in { position: relative; display: flex; align-items: center; gap: 40px; max-width: 1200px; height: 154px; margin: 0 auto; padding: 0 24px; }
.fd-header__logo { flex: none; display: block; }
.fd-header__logo img { display: block; width: 234px; height: auto; }
.fd-nav { display: flex; flex-wrap: wrap; background: var(--fd-navy); }
.fd-nav a { padding: 3px 10px; color: #fff; font-size: 17px; line-height: 24px; text-decoration: none; white-space: nowrap; }
.fd-nav a:hover { color: var(--fd-sky); }

/* Credito: sobre el extremo blanco del degradado. */
.fd-credit {
  position: absolute; top: 14px; right: 24px; display: flex; align-items: center; gap: 6px; margin: 0;
  padding: 4px 10px 4px 8px; border-radius: 999px; background: rgba(255, 255, 255, .75);
  box-shadow: 0 1px 2px rgba(4, 51, 83, .12); font-size: 12px; line-height: 18px; color: var(--fd-muted);
}
.fd-credit img { width: 18px; height: 18px; }
.fd-credit__name { font-family: Montserrat, var(--fd-sans); font-weight: 600; color: var(--fd-navy); }

.fd-header--compacta .fd-header__in { height: 96px; }
.fd-header--compacta .fd-header__logo img { width: 160px; }
.fd-header--compacta .fd-nav a { font-size: 15px; }

/* ---------- Pie (sitio oficial) ---------- */
.fd-footer { flex: none; padding: 12px 24px 14px; text-align: center; color: #fff; background: var(--fd-navy); }
.fd-footer__social { display: flex; align-items: center; justify-content: center; gap: 24px; }
.fd-footer__social strong { font-family: Montserrat, var(--fd-sans); font-weight: 600; font-size: 14px; }
.fd-footer__social a { display: inline-flex; color: #fff; }
.fd-footer__social a:hover { color: var(--fd-sky); }
.fd-footer__social svg { width: 22px; height: 22px; }
.fd-footer__copy { margin: 4px 0 0; font-size: 15px; color: #fffbfb; }

/* ---------- Login ---------- */
.fd-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 48px 16px 40px; }
.fd-card {
  width: 100%; max-width: 520px; padding: 28px 28px 24px; background: var(--fd-surface);
  border: 1px solid var(--fd-line); border-top: 4px solid var(--fd-sky); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(4, 51, 83, .08); display: grid; gap: 18px;
}
.fd-card__head { display: flex; align-items: flex-start; gap: 14px; }
.fd-card__icon { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 8px; background: var(--fd-blue); color: #fff; }
.fd-card__icon svg { width: 22px; height: 22px; }
.fd-card h1 { margin: 0; font-family: Roboto, var(--fd-sans); font-size: 22px; font-weight: 600; line-height: 1.25; color: var(--fd-navy); }
.fd-lead { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--fd-muted); }

.fd-field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; font-family: Roboto, var(--fd-sans); font-size: 14px; font-weight: 500; color: var(--fd-navy); }
.fd-field legend { padding: 0; margin-bottom: 6px; }
.fd-input {
  width: 100%; height: 46px; padding: 0 14px; font: inherit; font-family: var(--fd-sans); font-size: 16px; font-weight: 400; color: #1f2937;
  background: var(--fd-surface); border: 1px solid var(--fd-line-strong); border-radius: 8px; transition: border-color .15s, box-shadow .15s;
}
.fd-input::placeholder { color: #9aa1ab; }
.fd-input:focus { outline: none; border-color: var(--fd-blue); box-shadow: 0 0 0 3px var(--fd-blue-soft); }

/* Sucursal: botones; el radio queda oculto pero enfocable y el span muestra el estado. */
.fd-branches { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-branches label { position: relative; display: flex; flex: 1 1 auto; }
.fd-branches input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fd-branches span {
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 14px; text-align: center;
  font-family: Montserrat, var(--fd-sans); font-size: 14px; font-weight: 500; line-height: 1.2; color: var(--fd-navy);
  background: var(--fd-surface); border: 1px solid var(--fd-line-strong); border-radius: 8px; transition: background .15s, border-color .15s, color .15s;
}
.fd-branches label:hover span { border-color: var(--fd-blue); }
.fd-branches input:checked + span { color: #fff; background: var(--fd-navy); border-color: var(--fd-navy); }
.fd-branches input:focus-visible + span { outline: 2px solid var(--fd-blue); outline-offset: 2px; }

.fd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px;
  font-family: Montserrat, var(--fd-sans); font-size: 15px; font-weight: 500; line-height: 1.2; color: #fff; text-decoration: none;
  background: var(--fd-blue); border: 0; border-radius: 8px; cursor: pointer; transition: background .15s;
}
.fd-btn:hover { background: var(--fd-blue-hover); }
.fd-btn svg { width: 18px; height: 18px; flex: none; }
.fd-btn--block { width: 100%; min-height: 48px; }
.fd-btn--sm { padding: 8px 14px; font-size: 13px; }
.fd-btn--line { color: var(--fd-blue); background: var(--fd-surface); border: 1px solid var(--fd-blue); }
.fd-btn--line:hover { background: var(--fd-blue-soft); }

.fd-alert { margin: 0; padding: 10px 14px; font-size: 14px; color: var(--fd-bad); background: var(--fd-bad-bg); border: 1px solid var(--fd-bad-line); border-radius: 8px; }
.fd-nota { max-width: 520px; margin: 20px 0 0; font-size: 13px; line-height: 1.55; color: var(--fd-muted); text-align: center; }
.fd-nota strong { color: var(--fd-text); }

/* ---------- Resultado ---------- */
.fd-result { height: 100vh; }
.fd-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 1200px; margin: 0 auto; padding: 14px 24px; }
.fd-bar h1 { margin: 0; font-family: Roboto, var(--fd-sans); font-size: 20px; font-weight: 600; color: var(--fd-navy); }
.fd-bar form { margin: 0; }
.fd-actions { display: flex; gap: 8px; }
.fd-pdf-wrap { flex: 1; display: flex; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px 16px; min-height: 0; }
.fd-pdf { flex: 1; width: 100%; border: 1px solid var(--fd-line); border-radius: 8px; background: var(--fd-surface); }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .fd-header__in { gap: 24px; }
  .fd-header__logo img { width: 190px; }
  .fd-nav a { font-size: 15px; padding: 3px 8px; }
}

/* ---------- Celular y tablet vertical ---------- */
@media (max-width: 820px) {
  .fd-header__in { height: auto; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 18px 16px 0; }
  .fd-header__logo img { width: 176px; }
  .fd-header--compacta .fd-header__in { height: auto; padding-top: 12px; }
  .fd-header--compacta .fd-header__logo img { width: 128px; }
  .fd-nav { width: calc(100% + 32px); margin: 0 -16px; justify-content: center; padding: 4px 8px; }
  .fd-nav a { font-size: 14px; padding: 4px 8px; }
  .fd-credit { position: static; order: 3; width: calc(100% + 32px); margin: 0 -16px; justify-content: center; border-radius: 0; background: #fff; box-shadow: none; padding: 6px 12px; }
  .fd-header--compacta .fd-nav { display: none; }
  .fd-main { padding: 24px 16px 32px; }
  .fd-card { padding: 22px 18px 20px; }
  .fd-card h1 { font-size: 20px; }
  .fd-bar { padding: 12px 16px; }
  .fd-bar h1 { font-size: 17px; }
  .fd-pdf-wrap { padding: 0 16px 12px; }
}
@media (max-width: 520px) {
  .fd-branches { flex-direction: column; }
  .fd-branches span { justify-content: flex-start; padding-left: 16px; }
  .fd-footer__copy { font-size: 14px; }
}
@media (max-width: 420px) {
  .fd-nav a { font-size: 13px; padding: 4px 6px; }
  .fd-btn--sm { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
