/* ===== OxyGo Kids World — Acord & Regulament ===== */

:root {
  --navy: #1c3f70;
  --navy-dark: #142c4e;
  --yellow: #f5b800;
  --red: #e63946;
  --green: #4caf50;
  --purple: #8e44ad;
  --sky: #29abe2;
  --orange: #f39c12;

  --bg: #eef4fb;
  --card-bg: #ffffff;
  --ink: #1f2937;
  --ink-soft: #5b6472;
  --border: #e3e8f0;
  --border-strong: #cdd6e4;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow-card: 0 20px 60px -20px rgba(28, 63, 112, 0.35);
  --shadow-soft: 0 6px 18px -8px rgba(28, 63, 112, 0.25);

  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(41, 171, 226, 0.25), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(245, 184, 0, 0.2), transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(142, 68, 173, 0.18), transparent 45%),
    linear-gradient(160deg, var(--navy-dark), var(--navy) 55%, #234b82 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px 80px;
  position: relative;
  overflow-x: hidden;
}

/* Decorative stars */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.star {
  position: absolute;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  animation: twinkle 3.5s ease-in-out infinite;
}
.star-1 { top: 8%; left: 10%; font-size: 12px; animation-delay: 0s; }
.star-2 { top: 20%; left: 85%; font-size: 18px; animation-delay: .6s; }
.star-3 { top: 55%; left: 5%; font-size: 10px; animation-delay: 1.2s; }
.star-4 { top: 75%; left: 92%; font-size: 14px; animation-delay: 1.8s; }
.star-5 { top: 3%; left: 55%; font-size: 10px; animation-delay: 2.2s; }
.star-6 { top: 40%; left: 95%; font-size: 12px; animation-delay: 2.8s; }
@keyframes twinkle {
  0%, 100% { opacity: .25; transform: scale(1); }
  50% { opacity: .9; transform: scale(1.25); }
}

/* ===== Card ===== */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 36px 44px 40px;
  animation: cardIn .5s cubic-bezier(.2,.8,.2,1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 560px) {
  .card { padding: 24px 18px 30px; border-radius: var(--radius-md); }
}

/* ===== Header ===== */
.app-header {
  text-align: center;
  margin-bottom: 30px;
}
.logo {
  width: 150px;
  height: auto;
  margin-bottom: 10px;
  filter: drop-shadow(0 8px 16px rgba(28, 63, 112, 0.25));
}
.app-header h1 {
  font-family: 'Baloo 2', 'Nunito', sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--navy);
  margin: 4px 0 8px;
}
.subtitle {
  color: var(--ink-soft);
  font-size: .96rem;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ===== Steps ===== */
.step {
  margin-bottom: 34px;
  position: relative;
}
.step h2 {
  font-family: 'Baloo 2', 'Nunito', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 14px 44px;
}
.step-badge {
  position: absolute;
  top: -2px;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky), var(--navy));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
}
.step-badge span {
  color: white;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 600;
  font-size: .95rem;
}

/* ===== Rules box ===== */
.rules-box {
  background: #f8fafd;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 30px;
  height: min(62vh, 620px);
  max-height: min(62vh, 620px);
  min-height: 420px;
  overflow-y: auto;
  scroll-behavior: smooth;
  margin-left: 0;
}
@media (max-width: 560px) {
  .rules-box { margin-left: 0; height: min(52vh, 420px); max-height: min(52vh, 420px); min-height: 320px; padding: 18px 18px; }
  .step h2 { margin-left: 0; }
}

.rules-box::-webkit-scrollbar { width: 9px; }
.rules-box::-webkit-scrollbar-track { background: transparent; }
.rules-box::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
}
.rules-box::-webkit-scrollbar-thumb:hover { background: #a9b7cc; }

.rule-block { margin-bottom: 20px; }
.rule-block:last-child { margin-bottom: 4px; }
.rule-block h3 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 10px;
}
.rule-block p {
  font-size: .96rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 10px;
}
.rule-block ul,
.rule-block ol {
  margin: 0 0 12px;
  padding-left: 22px;
}
.rule-block li {
  font-size: .96rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.rule-block ol li {
  padding-left: 2px;
}
.rule-block-declaration {
  margin-top: 6px;
  padding-top: 18px;
  border-top: 2px dashed var(--border-strong);
}
.rule-block-declaration h3 {
  font-size: 1.02rem;
}

.scroll-hint, .scroll-done {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin: 14px auto 0;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 700;
  width: fit-content;
  max-width: 90%;
  text-align: center;
}
.scroll-hint[hidden], .scroll-done[hidden] {
  display: none;
}
.scroll-hint {
  color: var(--orange);
  background: rgba(243, 156, 18, 0.12);
  animation: bounce 1.8s ease-in-out infinite;
}
.scroll-hint svg { flex-shrink: 0; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}
.scroll-done {
  color: #1a8a45;
  background: rgba(76, 175, 80, 0.14);
}

/* ===== Form (locked state) ===== */
#step-form {
  transition: opacity .35s ease;
}
#step-form.locked {
  opacity: .45;
  pointer-events: none;
  filter: grayscale(.3);
}

.field {
  margin: 0 0 20px 44px;
}
@media (max-width: 560px) {
  .field { margin-left: 0; }
}

.field label {
  display: block;
  font-weight: 700;
  font-size: .88rem;
  color: var(--navy);
  margin-bottom: 6px;
}
.field-hint {
  font-size: .8rem;
  color: var(--ink-soft);
  margin: -2px 0 8px;
}

.field input[type="text"],
.field input[type="tel"] {
  width: 100%;
  padding: 12px 14px;
  font-size: .95rem;
  font-family: inherit;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input[type="text"]::placeholder,
.field input[type="tel"]::placeholder { color: #a7b0bf; }
.field input[type="text"]:focus,
.field input[type="tel"]:focus {
  outline: none;
  border-color: var(--sky);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(41, 171, 226, 0.15);
}
.field input.invalid {
  border-color: var(--red);
}

.field-error {
  display: none;
  color: var(--red);
  font-size: .78rem;
  font-weight: 700;
  margin-top: 6px;
}
.field.error .field-error { display: block; }
.field.error input[type="text"],
.field.error input[type="tel"] { border-color: var(--red); background: #fff6f6; }

/* ===== Signature pad ===== */
.signature-wrap {
  position: relative;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background:
    repeating-linear-gradient(135deg, rgba(41,171,226,.03) 0 10px, transparent 10px 20px),
    #fbfcfe;
  overflow: hidden;
}
.field.error .signature-wrap { border-color: var(--red); }

#signaturePad {
  display: block;
  width: 100%;
  height: 180px;
  touch-action: none;
  cursor: crosshair;
}
.signature-baseline {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 34px;
  border-bottom: 1.5px solid var(--border-strong);
  pointer-events: none;
}
.signature-placeholder {
  position: absolute;
  bottom: 40px;
  left: 24px;
  color: #b7c0cf;
  font-size: .85rem;
  font-style: italic;
  pointer-events: none;
  transition: opacity .15s ease;
}
.signature-placeholder.hidden { opacity: 0; }

.clear-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: white;
  border: 1.5px solid var(--border-strong);
  color: var(--ink-soft);
  font-family: inherit;
  font-weight: 700;
  font-size: .76rem;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
.clear-btn:hover {
  color: var(--red);
  border-color: var(--red);
  background: #fff5f5;
}

/* ===== Checkbox ===== */
.field-checkbox { margin-top: 26px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: .92rem;
  color: var(--navy);
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.checkbox-box {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid var(--border-strong);
  background: #fbfcfe;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s ease;
}
.checkbox-box svg {
  opacity: 0;
  transform: scale(.5);
  transition: all .18s ease;
}
.checkbox-label input:checked + .checkbox-box {
  background: linear-gradient(135deg, var(--green), #3d9640);
  border-color: #3d9640;
}
.checkbox-label input:checked + .checkbox-box svg {
  opacity: 1;
  transform: scale(1);
}
.checkbox-label input:focus-visible + .checkbox-box {
  box-shadow: 0 0 0 4px rgba(41, 171, 226, 0.2);
}
.field.error .checkbox-box { border-color: var(--red); }

/* ===== Submit ===== */
.submit-btn {
  display: block;
  width: calc(100% - 44px);
  margin-left: 44px;
  margin-top: 30px;
  padding: 15px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: .2px;
  color: white;
  background: linear-gradient(135deg, var(--sky), var(--navy) 120%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(28, 63, 112, 0.5);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(28, 63, 112, 0.55); }
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
@media (max-width: 560px) {
  .submit-btn { width: 100%; margin-left: 0; }
}

.submit-btn.loading {
  color: transparent;
  position: relative;
}
.submit-btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin: -10px 0 0 -10px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Success ===== */
.step-success {
  text-align: center;
  padding-top: 6px;
}
.success-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #3d9640);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 26px -8px rgba(76, 175, 80, 0.55);
  animation: pop .45s cubic-bezier(.3,1.6,.5,1);
}
@keyframes pop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.step-success h2 {
  font-family: 'Baloo 2', sans-serif;
  color: var(--navy);
  font-size: 1.3rem;
  margin: 0 0 8px;
}
.success-text {
  color: var(--ink-soft);
  margin: 0 0 22px;
}
.success-summary {
  text-align: left;
  background: #f8fafd;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.success-summary .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.success-summary .row:last-child { border-bottom: none; }
.success-summary .row span:first-child {
  color: var(--ink-soft);
  font-weight: 700;
}
.success-summary .row span:last-child {
  color: var(--ink);
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}
.success-summary img {
  display: block;
  margin-top: 6px;
  max-width: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.secondary-btn {
  padding: 12px 26px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 600;
  font-size: .92rem;
  color: var(--navy);
  background: white;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}
.secondary-btn:hover {
  border-color: var(--sky);
  color: var(--sky);
}
