/* ============================================================
   CONCURSA · forms.css
   Wizard de inscripción, votación y cuenta
   ============================================================ */

/* ---------- Wizard / Stepper ---------- */
.wizard { max-width: 720px; margin-inline: auto; }
.wizard__head { margin-bottom: var(--sp-6); }
.wizard__title { margin-bottom: var(--sp-2); }
.wizard__subtitle { color: var(--g-text-muted); }

.stepper {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-6); overflow-x: auto; padding-bottom: var(--sp-2);
}
.stepper__step {
  display: flex; align-items: center; gap: var(--sp-2);
  flex-shrink: 0; color: var(--g-text-muted); font-size: 0.85rem; font-weight: 600;
}
.stepper__bullet {
  width: 30px; height: 30px; border-radius: var(--r-full);
  background: #fff; border: 2px solid var(--g-border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 800; flex-shrink: 0;
}
.stepper__step[aria-current="step"] { color: var(--g-primary); }
.stepper__step[aria-current="step"] .stepper__bullet {
  background: var(--g-primary); border-color: var(--g-primary); color: #fff;
}
.stepper__step[data-done="true"] { color: var(--g-secondary); }
.stepper__step[data-done="true"] .stepper__bullet {
  background: var(--g-secondary); border-color: var(--g-secondary); color: #fff;
}
.stepper__sep { flex: 1; height: 2px; background: var(--g-border); min-width: 16px; }

.wizard__panel {
  background: #fff; border: 1px solid var(--g-border);
  border-radius: var(--r-lg); padding: var(--sp-5);
  box-shadow: var(--sh-1);
}
.wizard__panel h2 { font-size: 1.15rem; margin-bottom: var(--sp-5); }
.wizard__nav {
  display: flex; justify-content: space-between; gap: var(--sp-3);
  margin-top: var(--sp-5); flex-wrap: wrap;
}

/* ---------- Contador de caracteres ---------- */
.char-count { font-size: 0.78rem; color: var(--g-text-muted); text-align: right; }
.char-count[data-over="true"] { color: var(--g-error); font-weight: 700; }

/* ---------- Grid de campos ---------- */
.field-grid { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .field-grid--2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Mapa placeholder ---------- */
.map-placeholder {
  aspect-ratio: 16 / 9; background: var(--g-bg-soft);
  border: 1px dashed var(--g-border); border-radius: var(--r-md);
  display: grid; place-items: center; color: var(--g-text-muted);
  font-size: 0.9rem; position: relative; overflow: hidden;
}
.map-placeholder::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(11,61,145,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,61,145,.05) 1px, transparent 1px);
  background-size: 40px 40px;
}
.map-placeholder__pin {
  position: relative; z-index: 1;
  background: var(--g-primary); color: #fff;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-full);
  font-size: 0.8rem; font-weight: 700; box-shadow: var(--sh-2);
}

/* ---------- Resumen ---------- */
.summary { border: 1px solid var(--g-border); border-radius: var(--r-md); overflow: hidden; margin-bottom: var(--sp-4); }
.summary__row {
  display: grid; grid-template-columns: 40% 60%;
  gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--g-border); font-size: 0.9rem;
}
.summary__row:last-child { border-bottom: none; }
.summary__row dt { color: var(--g-text-muted); font-weight: 600; }
.summary__row dd { margin: 0; word-break: break-word; }

/* ---------- Dropzone ---------- */
.dropzone {
  display: block;
  border: 2px dashed var(--g-border); border-radius: var(--r-md);
  padding: var(--sp-5); text-align: center; cursor: pointer;
  transition: border-color var(--t-base), background var(--t-base);
  background: var(--g-bg-soft);
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--g-primary); background: var(--g-primary-light); }
.dropzone input[type=file] { display: none; }
.dropzone__icon { color: var(--g-primary); margin-bottom: var(--sp-2); display: flex; justify-content: center; }
.dropzone__hint { font-size: 0.82rem; color: var(--g-text-muted); }
.dropzone__preview { margin-top: var(--sp-3); font-size: 0.85rem; }

/* ---------- Galería de votación ---------- */
.vote-header {
  background: #fff; border-bottom: 1px solid var(--g-border);
  padding-block: var(--sp-4); position: sticky; top: 0; z-index: 50;
  box-shadow: var(--sh-1);
}
.vote-header__inner { display: grid; gap: var(--sp-3); }
@media (min-width: 768px) {
  .vote-header__inner { grid-template-columns: 1fr auto; align-items: center; }
}
.vote-progress {
  background: var(--g-primary-light); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4); font-size: 0.88rem; font-weight: 600;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3);
}
.vote-progress__bar {
  flex: 1; min-width: 120px; height: 8px;
  background: #fff; border-radius: var(--r-full); overflow: hidden;
}
.vote-progress__fill {
  height: 100%; background: var(--g-primary); width: 0%;
  transition: width var(--t-base); border-radius: var(--r-full);
}
.vote-progress__count { color: var(--g-primary-dark); white-space: nowrap; }

.vote-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding-block: var(--sp-4); align-items: center; }
.vote-filters select, .vote-filters input {
  padding: var(--sp-2) var(--sp-3); border: 1.5px solid var(--g-border);
  border-radius: var(--r-md); font-size: 0.88rem; background: #fff;
}
.vote-filters input { flex: 1; min-width: 180px; }

.shop-card--voted { outline: 3px solid var(--g-secondary); outline-offset: 2px; }
.shop-card__body { position: relative; }
.shop-card__score {
  position: absolute; top: var(--sp-3); right: var(--sp-3);
  background: var(--g-secondary); color: #fff;
  width: 36px; height: 36px; border-radius: var(--r-full);
  display: grid; place-items: center; font-weight: 800; font-size: 0.95rem;
  box-shadow: var(--sh-2);
}
.shop-card__score:empty { display: none; }
.shop-card__cta { margin-top: var(--sp-2); }

/* ---------- Modal de papeleta ---------- */
.vote-modal__photo {
  aspect-ratio: 4 / 3; background: var(--g-bg-soft);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  border-radius: var(--r-md); overflow: hidden; margin-bottom: var(--sp-4);
  display: grid; place-items: center;
  font-size: 3rem; font-weight: 800; color: rgba(0,0,0,.15);
}
.vote-scale { display: flex; gap: var(--sp-1); flex-wrap: wrap; border: none; padding: 0; margin-bottom: var(--sp-4); }
.vote-scale legend { font-weight: 700; font-size: 0.9rem; margin-bottom: var(--sp-2); padding: 0; }
.vote-scale__option { position: relative; }
.vote-scale__option input { position: absolute; opacity: 0; pointer-events: none; }
.vote-scale__option label {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--r-md);
  border: 2px solid var(--g-border); background: #fff;
  font-weight: 700; cursor: pointer; transition: all var(--t-fast);
}
.vote-scale__option label:hover { border-color: var(--g-primary); color: var(--g-primary); }
.vote-scale__option input:focus-visible + label { outline: 3px solid var(--g-accent); outline-offset: 2px; }
.vote-scale__option input:checked + label { background: var(--g-primary); border-color: var(--g-primary); color: #fff; }

.vote-modal__actions { display: flex; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-4); flex-wrap: wrap; }

/* ---------- Confirmación / estados ---------- */
.confirm-hero { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: var(--sp-7) var(--sp-4); }
.confirm-hero__icon {
  width: 88px; height: 88px; border-radius: var(--r-full);
  display: grid; place-items: center; margin: 0 auto var(--sp-5);
  background: var(--g-primary-light); color: var(--g-primary);
}
.confirm-hero__icon--ok    { background: #dcfce7; color: #14532d; }
.confirm-hero__icon--error { background: #fee2e2; color: #7f1d1d; }
.confirm-hero h1 { margin-bottom: var(--sp-3); }
.confirm-hero p  { color: var(--g-text-muted); max-width: 520px; margin-inline: auto; }

/* ---------- Mi cuenta ---------- */
.account-layout { display: grid; gap: var(--sp-5); grid-template-columns: 1fr; }
@media (min-width: 900px) { .account-layout { grid-template-columns: 220px 1fr; align-items: start; } }
.account-nav { display: flex; flex-direction: column; gap: var(--sp-1); }
.account-nav button {
  text-align: left; padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md); font-weight: 600; font-size: 0.9rem;
  color: var(--g-text); transition: background var(--t-fast);
}
.account-nav button:hover { background: var(--g-bg-soft); }
.account-nav button[aria-current="true"] { background: var(--g-primary); color: #fff; }
.account-panel[hidden] { display: none; }
.account-panel h2 { font-size: 1.15rem; margin-bottom: var(--sp-4); }

/* ---------- Badge grande de estado ---------- */
.status-large {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  font-weight: 700; font-size: 0.95rem;
}
.status-large--ok    { background: #dcfce7; color: #14532d; }
.status-large--warn  { background: #fef3c7; color: #78350f; }
.status-large--error { background: #fee2e2; color: #7f1d1d; }
.status-large--info  { background: #dbeafe; color: #1e3a8a; }

/* ---------- Login público ---------- */
.auth-card {
  max-width: 440px; margin: var(--sp-7) auto;
  background: #fff; border: 1px solid var(--g-border);
  border-radius: var(--r-lg); padding: var(--sp-6);
  box-shadow: var(--sh-2);
}
.auth-card h1 { font-size: 1.4rem; margin-bottom: var(--sp-2); text-align: center; }
.auth-card__sub { text-align: center; color: var(--g-text-muted); font-size: 0.9rem; margin-bottom: var(--sp-5); }
.auth-card__alt { text-align: center; margin-top: var(--sp-4); font-size: 0.88rem; color: var(--g-text-muted); }
.auth-card__alt a { color: var(--g-primary); font-weight: 600; }

/* ---------- Tabla simple reutilizable ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: var(--sp-3); text-align: left; border-bottom: 1px solid var(--g-border); }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--g-text-muted); }

/* ---------- VOTACION EN MOVIL (mobile first de verdad) --------------------- */
/* El 90 % de quien vota lo hace desde el movil. Aqui el progreso manda: se ve
   cuanto llevas, cuanto falta y el boton de enviar sin tener que buscar. */
@media (max-width: 639px) {
  .vote-progress {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px var(--sp-3);
    align-items: baseline;
    padding: var(--sp-3);
    font-size: 0.95rem;
  }
  .vote-progress__bar {
    grid-column: 1 / -1;
    min-width: 0;
    height: 10px;
    margin-top: var(--sp-2);
  }
  .vote-header { padding-block: var(--sp-3); }
  .vote-header .field-hint { text-align: center; }

  /* La escala de puntuacion: botones grandes, que se acierte con el dedo */
  .vote-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .vote-scale__option label {
    min-height: 48px;
    display: grid;
    place-items: center;
    font-size: 1rem;
  }

  /* La tarjeta: la foto no necesita comerse media pantalla */
  .shop-card__photo { aspect-ratio: 16 / 10; }
  .shop-card__actions .btn { width: 100%; min-height: 46px; }
}

/* En movil el stepper tiene que caber de una vez: solo el paso actual lleva su
   nombre, y los demas quedan como numero. Antes la tira medía 435 px en una
   pantalla de 390 y el ultimo paso se quedaba fuera. */
@media (max-width: 560px) {
  .stepper { gap: var(--sp-1); }
  .stepper__step:not([aria-current="step"]) > span:not(.stepper__bullet) { display: none; }
  .stepper__sep { min-width: 8px; }
}
