*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --brazil-green: #009739;
  --brazil-green-dark: #006b2e;
  --brazil-yellow: #ffdf00;
  --brazil-blue: #002776;
  --btn-green: #16a34a;
  --btn-green-dark: #15803d;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Fundo preto: a arte da Copa saiu para a página servir a qualquer
     formulário. As variáveis --brazil-* seguem no :root porque a arte do
     banner ainda pode usá-las. */
  background: #000;
  color: #0f172a;
  min-height: 100vh;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  width: 100%;
}

.hero {
  text-align: center;
  color: #f8fafc;
  margin-bottom: 24px;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero-logo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  object-fit: contain;
  border-radius: 12px;
}

.hero-banner {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto 16px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.hero.hero--has-banner .hero-logo {
  display: none;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 5vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.hero-lead {
  margin: 0 auto 16px;
  max-width: 36rem;
  opacity: 0.9;
  line-height: 1.55;
  font-size: clamp(0.875rem, 3.5vw, 0.95rem);
  padding: 0 4px;
}

.btn-regulamento {
  display: inline-block;
  margin-top: 4px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--btn-green);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.btn-regulamento:hover {
  background: var(--btn-green-dark);
  transform: translateY(-1px);
}

.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #fff;
  cursor: pointer;
  text-decoration: underline;
}

.footer-link-btn:hover {
  color: #ffdf00;
}

.regulamento-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.regulamento-modal[hidden] {
  display: none;
}

.regulamento-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.82);
}

.regulamento-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  max-height: min(90vh, 720px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.regulamento-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.regulamento-header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #0f172a;
}

.regulamento-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 0 4px;
}

.regulamento-close:hover {
  color: #0f172a;
}

.regulamento-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.65;
}

.regulamento-body h3 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  color: #0f172a;
}

.regulamento-body p {
  margin: 0 0 14px;
}

.regulamento-body ul {
  margin: 0 0 14px;
  padding-left: 1.25rem;
}

.regulamento-body li {
  margin-bottom: 10px;
}

.regulamento-body li:last-child {
  margin-bottom: 0;
}

.regulamento-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
  text-align: center;
}

.regulamento-footer .btn-primary {
  min-width: 120px;
}

.form-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 8px 0 20px;
  width: 100%;
  overflow: hidden;
}

.field-block {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
}

.field-block:last-of-type {
  border-bottom: none;
}

.field-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
}

.req {
  color: #dc2626;
}

.field-hint {
  margin: -6px 0 10px;
  font-size: 0.8rem;
  color: #64748b;
}

.text-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #cbd5e1;
  padding: 10px 0;
  font-size: 1rem;
  outline: none;
  background: transparent;
}

.text-input:focus {
  border-bottom-color: var(--btn-green);
}

select.text-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 24px;
}

select.text-input:disabled {
  cursor: not-allowed;
  color: #94a3b8;
}

.cidade-uf-row {
  display: flex;
  gap: 16px;
}

.cidade-uf-row select#estado {
  flex: 0 0 120px;
}

.cidade-uf-row select#cidade_municipio {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 519px) {
  .cidade-uf-row {
    gap: 10px;
  }

  .cidade-uf-row select#estado {
    flex: 0 0 96px;
  }
}

.match-meta[hidden] {
  display: none;
}

.match-meta {
  margin: -4px 0 12px;
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
}

.score-match {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
  width: 100%;
}

.score-team {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  max-width: 38%;
}

.score-team-home {
  justify-content: flex-end;
  text-align: right;
}

.score-team-away {
  justify-content: flex-start;
  text-align: left;
}

.score-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 1 auto;
  min-width: 0;
}

.team-flag {
  display: block;
  width: 28px;
  height: 19px;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  object-fit: cover;
  flex-shrink: 0;
}

.team-label {
  font-size: clamp(0.8rem, 2.8vw, 1.05rem);
  font-weight: 700;
  color: #334155;
  white-space: pre-line;
  text-align: center;
  line-height: 1.08;
  min-width: 0;
  max-width: 4.25rem;
}

.score-input {
  width: clamp(30px, 9vw, 44px);
  height: clamp(32px, 9.5vw, 46px);
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  text-align: center;
  font-size: clamp(0.9rem, 3.8vw, 1.15rem);
  font-weight: 700;
  color: #0f172a;
  outline: none;
  flex-shrink: 0;
  padding: 0;
  -moz-appearance: textfield;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.score-input:focus {
  border-color: var(--btn-green);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.score-sep {
  font-size: 1rem;
  font-weight: 800;
  color: #94a3b8;
  padding: 0 2px;
  flex-shrink: 0;
  line-height: 1;
}

.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-item,
.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
  cursor: pointer;
}

.radio-item input,
.checkbox-item input {
  margin-top: 4px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--btn-green);
}

.consent-block {
  background: #f8fafc;
}

.period-notice {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 10px;
  color: #9a3412;
  font-size: 0.95rem;
  line-height: 1.45;
}

.period-notice--closed {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.field-error {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: #b91c1c;
}

.text-input.input-invalid {
  border-color: #f87171;
  box-shadow: 0 0 0 1px #fecaca;
}

.form-error {
  margin: 0 24px 12px;
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 0.9rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 24px 0;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--btn-green);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover:not(:disabled) {
  background: var(--btn-green-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--btn-green-dark);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 12px 0;
}

.btn-ghost:hover {
  text-decoration: underline;
}

.success-screen {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 40px 28px 32px;
  text-align: center;
}

.success-header {
  margin-bottom: 24px;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
}

.success-title {
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 4.5vw, 1.5rem);
  line-height: 1.25;
  color: #0f172a;
}

.success-lead {
  margin: 0;
  color: #64748b;
  line-height: 1.55;
  font-size: 0.98rem;
}

.success-image {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto 24px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.success-image[hidden] {
  display: none;
}

.success-promo {
  margin-top: 8px;
  padding: 24px 20px;
  border-radius: 16px;
  background: linear-gradient(145deg, #f0fdf4 0%, #fefce8 45%, #eff6ff 100%);
  border: 1px solid rgba(0, 156, 59, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.success-promo[hidden] {
  display: none;
}

.success-promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #00b140 0%, #007a33 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.success-promo-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.success-promo-title {
  margin: 0 0 10px;
  font-size: clamp(1.05rem, 4vw, 1.2rem);
  line-height: 1.35;
  font-weight: 700;
  color: #0f172a;
}

.success-promo-subtitle {
  margin: 0 auto 20px;
  max-width: 34rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #475569;
}

.success-promo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  padding: 13px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #00b140 0%, #007a33 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 8px 20px rgba(0, 122, 51, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.success-promo-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 24px rgba(0, 122, 51, 0.34);
  color: #fff;
  text-decoration: none;
}

.success-promo-btn[hidden] {
  display: none;
}

.success-screen h2 {
  margin: 0 0 8px;
}

.success-screen p {
  margin: 0;
  color: #64748b;
  line-height: 1.5;
}

.footer {
  text-align: center;
  margin-top: 32px;
  color: rgba(248, 250, 252, 0.7);
  font-size: 0.8rem;
}

.footer a {
  color: #fff;
}

@media (min-width: 520px) {
  .score-match {
    gap: 14px;
  }

  .score-team {
    gap: 8px;
    flex: 0 1 auto;
    max-width: none;
  }

  .score-inputs {
    gap: 10px;
  }

  .team-label {
    font-size: 1.2rem;
    max-width: 5.5rem;
    line-height: 1.1;
  }

  .team-flag {
    width: 40px;
    height: 27px;
  }

  .score-input {
    width: clamp(48px, 5rem, 56px);
    height: clamp(50px, 5.25rem, 58px);
    font-size: 1.5rem;
    border-radius: 12px;
  }

  .score-sep {
    font-size: 1.25rem;
    padding: 0 4px;
  }
}

@media (max-width: 519px) {
  .page {
    padding: 16px 12px 32px;
  }

  .hero-logo {
    width: 64px;
    height: 64px;
  }

  .btn-regulamento {
    width: 100%;
    max-width: 320px;
  }

  .field-block {
    padding: 16px;
  }

  .field-label {
    font-size: 0.95rem;
  }

  .form-error {
    margin-left: 16px;
    margin-right: 16px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 0;
    gap: 8px;
  }

  .btn-primary,
  .btn-ghost {
    width: 100%;
    text-align: center;
  }

  .success-screen {
    padding: 32px 16px 24px;
  }

  .success-promo {
    padding: 20px 16px;
  }

  .success-promo-btn {
    width: 100%;
    min-width: 0;
  }

  .regulamento-body {
    padding: 16px;
  }

  .score-match {
    gap: 4px;
    padding: 10px 0;
  }

  .score-team {
    gap: 3px;
    max-width: 36%;
  }

  .team-label {
    font-size: clamp(0.72rem, 3.1vw, 0.92rem);
    max-width: 3.6rem;
    line-height: 1.06;
  }

  .team-flag {
    width: 22px;
    height: 15px;
    flex-shrink: 0;
  }

  .score-inputs {
    gap: 3px;
    flex: 1 1 auto;
  }

  .score-input {
    width: clamp(28px, 8vw, 36px);
    height: clamp(30px, 8.5vw, 38px);
    font-size: clamp(0.85rem, 3.5vw, 1rem);
    border-radius: 7px;
    border-width: 1px;
  }

  .score-sep {
    font-size: clamp(0.75rem, 3vw, 0.85rem);
    padding: 0 1px;
  }
}
