/* ─────────────────────────────────────────────────────────────
   Libro de Reclamaciones — Catalina Miranda
   Paleta y tipografía alineadas a la web principal
   ───────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Hardbob";
  src: url("../assets/fonts/Hardbop-Black.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Agenda One";
  src: url("../assets/fonts/agenda-one-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens de diseño (iguales a la web principal) ── */
:root {
  --red:         #ed1c24;
  --yellow:      #ffac0b;
  --black:       #000000;
  --white:       #ffffff;
  --bg:          #ffffff;
  --muted:       #faf8f5;
  --text:        #111;
  --border:      rgba(0,0,0,.10);
  --shadow:      0 18px 50px rgba(0,0,0,.10);

  --font-title:  "Hardbob", system-ui, -apple-system, Segoe UI, Roboto, Arial;
  --font-body:   "Agenda One", system-ui, -apple-system, Segoe UI, Roboto, Arial;

  --radius-card: 22px;
  --radius-btn:  999px;
  --radius-field:12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
a { color: inherit; }

/* ── Contenedor ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 18px; }
.wrapper   { max-width: 700px;  margin: 0 auto; padding: 2rem 18px 5rem; }

/* ════════════════════════════════════════════════════════════
   HEADER — idéntico al de la web principal
   ════════════════════════════════════════════════════════════ */
.header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  height: 80px;
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand__logo {
  height: 44px;
  width: auto;
  display: block;
}
.header-back {
  font-size: 13px;
  text-decoration: none;
  opacity: .6;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity .15s;
}
.header-back:hover { opacity: 1; }

/* ════════════════════════════════════════════════════════════
   AVISO OFICIAL — fondo rojo como hero de la web
   (Anexo II DS 011-2011-PCM)
   ════════════════════════════════════════════════════════════ */
.aviso {
  background: var(--red);
  color: var(--white);
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
  border-bottom: 3px solid var(--black);
  position: relative;
  overflow: hidden;
}
/* Patrón de fondo sutil */
.aviso::before {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 20px,
    rgba(0,0,0,.04) 20px,
    rgba(0,0,0,.04) 21px
  );
  pointer-events: none;
}
.aviso__badge {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: var(--radius-btn);
  margin-bottom: 1rem;
  position: relative;
}
.aviso__title {
  font-family: var(--font-title);
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: .5px;
  line-height: 1;
  margin-bottom: .75rem;
  position: relative;
}
.aviso__sub {
  font-size: 15px;
  opacity: .9;
  max-width: 480px;
  margin: 0 auto .75rem;
  line-height: 1.6;
  position: relative;
}
.aviso__ley {
  display: inline-block;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-btn);
  padding: 4px 14px;
  font-size: 11px;
  letter-spacing: 1px;
  position: relative;
}

/* ════════════════════════════════════════════════════════════
   DATOS DEL PROVEEDOR — card muted como en la web
   ════════════════════════════════════════════════════════════ */
.proveedor-card {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 24px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
}
@media (max-width: 480px) { .proveedor-card { grid-template-columns: 1fr; } }
.proveedor-item__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 2px;
}
.proveedor-item__val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* ════════════════════════════════════════════════════════════
   TIPO SELECTOR — queja / reclamo
   ════════════════════════════════════════════════════════════ */
.tipo-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tipo-input { display: none; }
.tipo-label {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  cursor: pointer;
  transition: all .15s ease;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tipo-label:hover { border-color: rgba(0,0,0,.25); }
.tipo-input[value="reclamo"]:checked + .tipo-label {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}
.tipo-input[value="queja"]:checked + .tipo-label {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #3a2000;
}
.tipo-label .tipo-name {
  font-family: var(--font-title);
  font-size: 20px;
  line-height: 1;
  letter-spacing: .3px;
}
.tipo-label .tipo-desc {
  font-size: 12px;
  opacity: .75;
  line-height: 1.4;
}
.tipo-input:checked + .tipo-label .tipo-desc { opacity: .85; }

/* ════════════════════════════════════════════════════════════
   SECCIONES DEL FORMULARIO — estilo product-block
   ════════════════════════════════════════════════════════════ */
.form-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 14px 40px rgba(0,0,0,.05);
  margin-bottom: 16px;
}
.form-block__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}
.form-block__num {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--red);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.form-block__title {
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: .3px;
}
.form-block__body { padding: 22px 24px; }
@media (max-width: 480px) {
  .form-block__body { padding: 16px; }
}

/* ════════════════════════════════════════════════════════════
   CAMPOS
   ════════════════════════════════════════════════════════════ */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}
.field__label .req  { color: var(--red); margin-left: 2px; }
.field__label .hint { font-weight: 400; color: #999; font-size: 12px; margin-left: 4px; }

.field__input,
.field__select,
.field__textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(237,28,36,.1);
}
.field__input.is-invalid,
.field__select.is-invalid,
.field__textarea.is-invalid { border-color: var(--red); }

.field__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.field__textarea { resize: vertical; min-height: 96px; }

.field__error {
  display: none;
  font-size: 12px;
  color: var(--red);
  margin-top: 4px;
}
.field__error.is-visible { display: block; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.field__counter {
  text-align: right;
  font-size: 11px;
  color: #aaa;
  margin-top: 4px;
}

/* ── Toggle menor de edad ── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  background: var(--muted);
  cursor: pointer;
  user-select: none;
  margin-bottom: 14px;
}
.toggle-row input { display: none; }
.toggle-switch {
  width: 40px; height: 22px;
  background: var(--border);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  transition: background .15s;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: transform .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-row input:checked ~ .toggle-switch { background: var(--red); border-color: var(--red); }
.toggle-row input:checked ~ .toggle-switch::after { transform: translateX(18px); }
.toggle-text { font-size: 13px; font-weight: 600; }

.menor-fields { display: none; }
.menor-fields.is-visible { display: block; }

/* ════════════════════════════════════════════════════════════
   CONSENTIMIENTO
   ════════════════════════════════════════════════════════════ */
.consent-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--muted);
  cursor: pointer;
  margin-bottom: 14px;
}
.consent-row input[type="checkbox"] {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--red);
  cursor: pointer;
}
.consent-text {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}
.consent-text a { color: var(--red); text-underline-offset: 2px; }

/* ════════════════════════════════════════════════════════════
   BOTONES — idénticos a la web principal
   ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary {
  background: var(--red);
  color: var(--white);
}
.btn--primary:hover:not(:disabled) { opacity: .88; }
.btn--outline {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.btn--outline:hover { border-color: rgba(0,0,0,.25); }
.btn--full { width: 100%; }

/* ── Spinner en el botón ── */
.btn__spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn--loading .btn__label  { display: none; }
.btn--loading .btn__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error global ── */
.form-error {
  display: none;
  background: #fff0f0;
  border: 1px solid rgba(237,28,36,.3);
  border-radius: var(--radius-field);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--red);
  margin-top: 12px;
}
.form-error.is-visible { display: block; }

/* ════════════════════════════════════════════════════════════
   DERECHOS DEL CONSUMIDOR
   ════════════════════════════════════════════════════════════ */
.derechos {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-top: 2rem;
}
.derechos__header {
  background: var(--black);
  color: var(--white);
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.derechos__body {
  padding: 16px 20px;
  font-size: 13px;
  color: #555;
  line-height: 1.6;
}
.derechos__body ul {
  padding-left: 18px;
  margin-top: 6px;
}
.derechos__body li { margin-bottom: 4px; }
.derechos__body a { color: var(--red); }

/* ════════════════════════════════════════════════════════════
   PÁGINA DE CONFIRMACIÓN
   ════════════════════════════════════════════════════════════ */
.confirm-hero {
  background: var(--red);
  color: var(--white);
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
  border-bottom: 3px solid var(--black);
  position: relative;
  overflow: hidden;
}
.confirm-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    45deg, transparent, transparent 20px,
    rgba(0,0,0,.04) 20px, rgba(0,0,0,.04) 21px
  );
  pointer-events: none;
}
.confirm-hero__icon {
  width: 64px; height: 64px;
  background: rgba(0,0,0,.2);
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 50%;
  margin: 0 auto 1.25rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  position: relative;
}
.confirm-hero__title {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  line-height: 1;
  margin-bottom: .6rem;
  position: relative;
}
.confirm-hero__sub {
  font-size: 15px;
  opacity: .9;
  position: relative;
}

/* Número correlativo */
.num-card {
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-card);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.num-card__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: .6;
  margin-bottom: 4px;
}
.num-card__value {
  font-family: var(--font-title);
  font-size: 1.6rem;
  letter-spacing: 1px;
  color: var(--yellow);
}
.num-card__date { font-size: 13px; opacity: .6; }

/* Alerta plazo */
.plazo-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fffbe6;
  border: 1px solid var(--yellow);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}
.plazo-card__icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }
.plazo-card strong { display: block; margin-bottom: 2px; }

/* Recibo imprimible */
.recibo {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.recibo__header {
  background: var(--black);
  color: var(--white);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.recibo__header-title {
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: .5px;
}
.recibo__header-ds {
  font-size: 11px;
  opacity: .5;
  letter-spacing: .5px;
}
.recibo__body { padding: 24px; }

.recibo-section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.recibo-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.recibo-section__title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.recibo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
@media (max-width: 480px) { .recibo-grid { grid-template-columns: 1fr; } }
.dato__key {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 2px;
}
.dato__val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.badge-tipo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-family: var(--font-title);
  letter-spacing: .3px;
}
.badge-tipo--reclamo { background: var(--red); color: var(--white); }
.badge-tipo--queja   { background: var(--yellow); color: #3a2000; }

.detalle-box {
  font-size: 13px;
  line-height: 1.6;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 420px) { .confirm-actions { grid-template-columns: 1fr; } }

.indecopi-note {
  text-align: center;
  font-size: 12px;
  color: #999;
  line-height: 1.7;
}
.indecopi-note a { color: var(--red); text-underline-offset: 2px; }

/* ════════════════════════════════════════════════════════════
   PRINT
   ════════════════════════════════════════════════════════════ */
@media print {
  body { background: white; }
  .header, .confirm-hero, .num-card, .plazo-card, .confirm-actions, .indecopi-note { display: none !important; }
  .wrapper { padding: 0; max-width: 100%; }
  .recibo { box-shadow: none; border: 1px solid #ccc; }
  .recibo__header {
    background: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .badge-tipo--reclamo, .badge-tipo--queja {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  /* Encabezado solo para impresión */
  .print-only-header {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 2px solid #000;
  }
  .print-only-header h1 {
    font-family: var(--font-title), serif;
    font-size: 1.6rem;
    margin: 0;
  }
  .print-only-header p {
    font-size: 12px;
    color: #666;
    text-align: right;
    margin: 0;
  }
}
.print-only-header { display: none; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 920px) {
  .brand__logo {
    height: 40px;
  }
}
