/* Cogua Aquatics — Checkout styles */

:root {
  /* Paleta de marca AZUL (oficial, extraída del logo CoguaAquatics_logo_800x800.png). */
  --blue:         #2995CB;   /* azul primario — rgb(41,149,203) */
  --blue-dark:    #1D688E;   /* hover/active */
  --blue-light:   #E8F3FA;   /* fondos/highlights */
  /* Alias retro: el sitio referencia --green*; ahora RINDEN AZUL (no queda verde). */
  --green:        var(--blue);
  --green-dark:   var(--blue-dark);
  --green-light:  var(--blue-light);
  --bg:           #f5f5f3;
  --card-bg:      #ffffff;
  --text:         #1a1a1a;
  --text-muted:   #6b6b6b;
  --text-faint:   #9b9b9b;
  --border:       rgba(0,0,0,0.1);
  --border-strong:rgba(0,0,0,0.3);
  --error:        #d92d20;
  --radius:       8px;
  --radius-lg:    12px;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.45;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.page-header { text-align: center; margin-bottom: 24px; }
.page-header h1 { color: var(--green); font-size: 28px; margin: 0 0 4px; }
.page-header .subtitle { color: var(--text-muted); margin: 0; font-size: 15px; }

/* Logo de marca en la esquina superior izquierda (no consume espacio vertical). */
.brand-logo { position: absolute; top: 10px; left: 14px; width: 80px; height: auto; margin: 0; z-index: 30; }
@media (max-width: 480px) { .brand-logo { width: 58px; top: 8px; left: 10px; } }

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card h2 { font-size: 17px; margin: 0 0 16px; }

.label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0 10px;
}
.label:first-child { margin-top: 0; }

.grid { display: grid; gap: 8px; margin-bottom: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.opt {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
  background: white;
}
.opt:hover { border-color: var(--green); }
.opt.is-selected {
  border: 2px solid var(--green);
  background: var(--green-light);
}
.opt-name  { font-size: 13px; font-weight: 700; }
.opt-sub   { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
.opt-big   { font-size: 22px; font-weight: 800; line-height: 1; }
.opt.is-selected .opt-name  { color: var(--green); }
.opt.is-selected .opt-sub   { color: var(--green); opacity: 0.75; }
.opt.is-selected .opt-big   { color: var(--green); }

.row { margin-bottom: 12px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }

.field { display: flex; flex-direction: column; }
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.field input,
.field select,
.field textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(41, 149, 203, 0.12);
}
.field input.invalid,
.field select.invalid {
  border-color: var(--error);
}
.req { color: var(--error); }
.hint { font-size: 12px; color: var(--text-faint); margin: 4px 0 0; }
.hint-error { color: var(--error); margin-top: 8px; min-height: 16px; font-weight: 500; }

.price-box {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 12px;
}
.placeholder { color: var(--text-faint); text-align: center; margin: 8px 0; font-size: 14px; }
.price-row { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; font-size: 14px; }
.price-row strong { font-weight: 600; }
.price-row.total { padding-top: 8px; border-top: 1px solid var(--border-strong); margin-top: 8px; }
.price-row.total span:first-child { font-weight: 700; font-size: 15px; }
.price-row.total span:last-child { color: var(--green); font-weight: 800; font-size: 18px; }
.price-note { font-size: 12px; color: var(--text-faint); margin-top: 10px; }

.student-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
}
.student-block-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.remove-student {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 18px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
}
.link-btn:hover { color: var(--green-dark); }

.btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-primary { background: var(--green); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--green-dark); }
.btn:disabled { background: #c8c8c8; color: #888; cursor: default; }
.btn.btn-incomplete { background: #c8c8c8; color: #888; cursor: pointer; }

.hidden { display: none !important; }

.policy-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: white;
}
.policy-details {
  padding: 0;
}
.policy-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  outline: none;
}
.policy-summary::-webkit-details-marker { display: none; }
.policy-summary-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.policy-summary-toggle {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}
.policy-details[open] .policy-summary-toggle::after { content: ""; }
.policy-details[open] .policy-summary-toggle { content: "Hide details ▴"; }
.policy-body {
  padding: 0 14px 12px;
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.55;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.policy-check {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  margin: 0;
  background: var(--bg);
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 13px;
}
.check-row input { margin-top: 2px; cursor: pointer; }
.check-row.check-all {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.sig-wrap {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
}
#signature-pad {
  display: block;
  width: 100%;
  max-width: 100%;
  touch-action: none;
}

.info-box {
  background: var(--green-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text);
  margin-top: 8px;
}

#stripe-element,
#stripe-element-cash {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: white;
}

.day-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.day-btn {
  flex: 1 1 calc(14.28% - 6px);
  min-width: 60px;
  padding: 10px 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.day-btn:hover { border-color: var(--green); }
.day-btn.is-active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

/* Parent & Me fixed slot tiles — vertical stack of full-width tiles. */
.parentme-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.parentme-slot-btn {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.parentme-slot-btn:hover { border-color: var(--green); }
.parentme-slot-btn.is-active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.time-rows {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-top: 8px;
}
.time-rows:empty { display: none; }
.time-rows-header {
  display: grid;
  grid-template-columns: 90px 1fr 80px 70px;
  gap: 10px;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.time-row {
  display: grid;
  grid-template-columns: 90px 1fr 80px 70px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
}
.time-row select,
.time-row input[type="time"] {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  outline: none;
  width: 100%;
}
.time-row select:focus,
.time-row input[type="time"]:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(41,149,203,0.12);
}
.time-col.day-col { font-weight: 600; }

@media (max-width: 480px) {
  .day-btn { flex: 1 1 calc(25% - 6px); }
  .time-rows-header, .time-row {
    grid-template-columns: 70px 1fr 70px 60px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .page { padding: 16px 12px 60px; }
  .card { padding: 16px; }
}

/* ── Toast notification ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  z-index: 9999;
  width: min(92vw, 400px);
  background: #d92d20;
  color: white;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
  pointer-events: none;
}
.toast.toast-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.toast-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 700; font-size: 13px; margin-bottom: 3px; }
.toast-msg-text { white-space: pre-line; font-size: 13px; opacity: 0.92; }
.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 0 0 4px;
  flex-shrink: 0;
  transition: color 0.12s;
}
.toast-close:hover { color: white; }

/* ── Field-level error highlights ───────────────────────────────────────── */
.field input.field-error,
.field select.field-error,
.field textarea.field-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.15) !important;
}
.field-error-msg {
  font-size: 11px;
  color: var(--error);
  margin-top: 4px;
  font-weight: 600;
}
.card.card-error { box-shadow: 0 0 0 2px var(--error); }
.sig-wrap.field-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.15);
}
.day-toggles.field-error {
  outline: 2px solid var(--error);
  outline-offset: 3px;
  border-radius: var(--radius);
}
.grid.grid-error {
  outline: 2px solid var(--error);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* ── Secondary toggle button (small, low-emphasis opt-in/out tiles) ─────────
   Used for: save-card (cash, regional center) + cardholder-different.
   Designed to be smaller than the primary payment-method tiles so it stays
   visually secondary — easy to click intentionally but not the eye magnet. */
.secondary-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.secondary-toggle:hover { border-color: var(--green); }
.secondary-toggle.is-selected {
  border-color: var(--green);
  background: rgba(41, 149, 203, 0.06);
}
.secondary-toggle-check {
  font-size: 16px;
  color: var(--text-faint);
  flex-shrink: 0;
  transition: color 0.15s;
  width: 16px;
  text-align: center;
}
.secondary-toggle.is-selected .secondary-toggle-check {
  color: var(--green);
}
.secondary-toggle-text { flex: 1; font-weight: 500; }
.secondary-toggle-text em {
  color: var(--green);
  font-style: normal;
  font-weight: 600;
}
.secondary-toggle-hint {
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
}

/* ── Progress bar (sticky at top, shows form section status) ───────────────
   Sections auto-mark as "complete" when their primary fields are filled; the
   active section is highlighted while user scrolls. Clicking a step scrolls
   to that section. */
.progress-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px 10px;
  margin: 0 -20px 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.progress-track {
  position: relative;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 14px;
}
.progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--green);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}
.progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.progress-step { flex: 1; min-width: 0; }
.progress-step a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-faint);
  transition: color 0.15s;
}
.progress-step a:hover { color: var(--green); }
.progress-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--card-bg);
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s;
}
.progress-step.is-complete .progress-num {
  background: var(--green);
  color: white;
}
.progress-step.is-complete .progress-num::before { content: "✓"; }
.progress-step.is-complete .progress-num { font-size: 0; }
.progress-step.is-complete .progress-num::before { font-size: 12px; }
.progress-step.is-active .progress-num {
  background: var(--green-light);
  color: var(--green);
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.progress-step.is-active a { color: var(--green); font-weight: 600; }
.progress-label {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
@media (max-width: 600px) {
  .progress-label { display: none; }
  .progress-bar { padding: 10px 16px 8px; }
}

/* ── Floating field hint (small bubble that appears next to focused input) ─
   Triggered on focus of inputs that have a data-hint="..." attribute.
   The hint is rendered into a single shared #floating-hint container so we
   don't pollute the DOM with per-field tooltips. */
#floating-hint {
  position: fixed;
  z-index: 60;
  background: var(--text);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  max-width: 280px;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
}
#floating-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}
#floating-hint::before {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -6px;
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--text);
}

/* ── Split-pay selector (inside the pricing panel) ──────────────────────────
   Three buttons (Both / Registration only / Tuition only) so the vendor can
   choose what to charge today on monthly plans. Hidden for prepays. */
.split-pay {
  margin: 14px 0 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.split-pay-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.split-pay-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.split-pay-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: white;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all 0.15s;
}
.split-pay-btn:hover { border-color: var(--green); }
.split-pay-btn.is-active {
  border-color: var(--green);
  background: var(--green-light);
}
.split-pay-btn-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.split-pay-btn-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.split-pay-extra {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.split-pay-extra label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.split-pay-extra input[type="date"] {
  width: 100%;
  max-width: 220px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
}
@media (max-width: 600px) {
  .split-pay-options { grid-template-columns: 1fr; }
}
