/* =========================================================
   Libro de Reclamaciones — Clínica Barrenechea
   Paleta y tipografía tomadas de clinicabarrenechea.pe
   ========================================================= */

:root {
  /* Colores de marca */
  --primary: #0092bc;          /* cyan corporativo */
  --primary-dark: #00789b;
  --accent: #cc6e6b;           /* coral del logo */
  --navy: #334862;             /* azul oscuro */
  --ink: #27282c;              /* títulos */
  --text: #777777;             /* texto de cuerpo */
  --muted: #9f9e9e;
  --line: #ececec;
  --line-soft: #f1f1f1;
  --white: #ffffff;
  --error: #cc4b4b;
  --success: #2e7d5b;
  --success-bg: #eafaf2;

  /* Superficies neutras (sin celeste) */
  --surface: #e5e1e6;          /* gris cálido para fondos */
  --surface-soft: #f2f0f3;     /* variante más clara */

  /* Tipografía */
  --font-head: "Josefin Sans", sans-serif;
  --font-body: "Lato", sans-serif;

  --radius: 12px;              /* inputs */
  --radius-lg: 16px;           /* tarjetas internas / radios */
  --radius-card: 24px;         /* card principal */
  --shadow-card: 0 30px 70px -35px rgba(51, 72, 98, 0.22);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─────────── Header ─────────── */
.site-header {
  border-bottom: 1px solid var(--line-soft);
  background: var(--white);
}
.header-inner {
  display: flex;
  align-items: center;
  min-height: 78px;
}
.brand { display: flex; flex-direction: column; line-height: 1; }
.brand:hover { text-decoration: none; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.08em;
}
.brand-name--primary { color: var(--primary); }
.brand-name--accent { color: var(--accent); }
.brand-sub {
  margin-top: 5px;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

/* ─────────── Hero ─────────── */
.hero {
  background: linear-gradient(180deg, var(--surface) 0%, #ffffff 100%);
  padding: 64px 0 88px;
}
.hero-inner { max-width: 720px; }
.eyebrow {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--primary);
}
.hero-title {
  font-family: var(--font-head);
  font-weight: 300;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 20px;
}
.hero-title--accent { color: var(--primary); font-weight: 600; }
.hero-lead {
  margin: 0;
  font-size: 16px;
  font-weight: 300;
  color: var(--text);
  max-width: 640px;
}
.hero-lead strong { color: var(--navy); font-weight: 700; }

/* ─────────── Card / Form ─────────── */
.form-wrap {
  margin-top: -56px;
  margin-bottom: 72px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 44px;
}

.block + .block { margin-top: 0; }

.section-tag {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--primary);
}
.section-title {
  font-family: var(--font-head);
  font-weight: 300;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.15;
  color: var(--navy);
  margin: 0 0 28px;
}
.section-title--accent { color: var(--primary); font-weight: 600; font-style: italic; }

.divider {
  border: none;
  border-top: 1px solid var(--line-soft);
  margin: 40px 0;
}

/* ─────────── Grid & fields ─────────── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.field { display: block; }
.field--full { grid-column: 1 / -1; }
/* Solo separa campos apilados fuera del grid (evita desalinear columnas) */
.block > .field + .field { margin-top: 20px; }

.label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--navy);
}
.req { color: var(--accent); }

/* ─────────── Controls ─────────── */
.control {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #dcdfe3;
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.control::placeholder { color: #b7bcc2; }
.control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 146, 188, 0.15);
}
.control--textarea { resize: none; line-height: 1.6; }
.control.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(204, 75, 75, 0.12);
}

/* ─────────── Custom select ─────────── */
.custom-select { position: relative; }

.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  text-align: left;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #dcdfe3;
  border-radius: var(--radius);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cs-trigger:hover { border-color: #c3c8ce; }
.cs-trigger.is-open {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 146, 188, 0.15);
}
.cs-trigger.is-invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(204, 75, 75, 0.12);
}
.cs-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-value.is-placeholder { color: #b7bcc2; }

.cs-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--muted);
  transition: transform 0.3s, color 0.2s;
}
.cs-trigger.is-open .cs-chevron { transform: rotate(180deg); color: var(--primary); }

.cs-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 50px -20px rgba(51, 72, 98, 0.28);
  animation: cs-in 0.16s ease;
}
.cs-list[hidden] { display: none; }
@keyframes cs-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.cs-list li { margin: 0; }

.cs-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cs-option.is-highlight { background: var(--surface-soft); color: var(--ink); }
.cs-option.is-selected {
  background: var(--surface-soft);
  color: var(--navy);
  font-weight: 700;
}
.cs-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--primary);
  opacity: 0;
}
.cs-option.is-selected .cs-check { opacity: 1; }

/* ─────────── Radios (Reclamo / Queja) ─────────── */
.radio-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dcdfe3;
  border-radius: var(--radius-lg);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.radio-card:hover { border-color: rgba(0, 146, 188, 0.5); }
.radio-card.is-active {
  border-color: var(--primary);
  background: var(--surface-soft);
  box-shadow: 0 10px 28px -18px rgba(51, 72, 98, 0.3);
}
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-dot {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid #c3c8ce;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}
.radio-card.is-active .radio-dot { border-color: var(--primary); }
.radio-dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  transform: scale(0);
  transition: transform 0.18s;
}
.radio-card.is-active .radio-dot::after { transform: scale(1); }
.radio-title {
  display: block;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}
.radio-desc {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 300;
  color: var(--text);
}

/* ─────────── Counter & errors ─────────── */
.counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.counter { font-size: 11px; color: var(--muted); margin-left: auto; }
.counter.is-warning { color: var(--error); }
.field-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--error);
  min-height: 0;
}
.field-error:empty { display: none; }

/* ─────────── Notice ─────────── */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid #e0dce2;
  border-radius: var(--radius-lg);
}
.notice-icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--primary); margin-top: 1px; }
.notice p { margin: 0; font-size: 13px; font-weight: 300; color: var(--navy); }
.notice strong { font-weight: 700; }

/* ─────────── Checkbox ─────────── */
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  cursor: pointer;
  user-select: none;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  margin-top: 2px;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1px solid #c3c8ce;
  border-radius: 6px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.check-box svg { width: 12px; height: 12px; color: #fff; opacity: 0; transition: opacity 0.15s; }
.check input:checked + .check-box { background: var(--primary); border-color: var(--primary); }
.check input:checked + .check-box svg { opacity: 1; }
.check input:focus-visible + .check-box { box-shadow: 0 0 0 3px rgba(0, 146, 188, 0.2); }
.check-text { flex: 1; font-size: 13px; font-weight: 300; color: var(--text); }
.check-text a { font-weight: 700; color: var(--navy); }

/* ─────────── Submit button ─────────── */
.submit-row { margin-top: 32px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-head);
}
.btn:disabled { cursor: not-allowed; opacity: 0.5; }
.btn-label {
  background: var(--primary);
  color: #fff;
  padding: 16px 30px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: background 0.35s;
}
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  transition: background 0.35s;
}
.btn-icon svg { width: 20px; height: 20px; }
.btn:not(:disabled):hover .btn-label,
.btn:not(:disabled):hover .btn-icon { background: var(--navy); }
.btn.is-loading .btn-icon svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────── Alerts ─────────── */
.alert {
  margin-bottom: 28px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  line-height: 1.55;
}
.alert--success { background: var(--success-bg); border: 1px solid #b6e3cd; color: var(--success); }
.alert--error { background: #fdecec; border: 1px solid #f3c2c2; color: var(--error); }

/* ─────────── Footer ─────────── */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 28px 0;
  text-align: center;
}
.site-footer p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ─────────── Responsive ─────────── */
@media (max-width: 640px) {
  .card { padding: 28px 20px; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 72px; }
  .btn-label { padding: 14px 22px; }
}
