:root {
  --bg: #FBF6EC;
  --text: #2A2420;
  --text-muted: #6E6455;
  --text-muted-2: #8A8072;
  --green-dark: #2F5233;
  --green-light: #3C6640;
  --green-bg: #EAF1E6;
  --green-border: #CBDDC2;
  --orange: #E2603A;
  --orange-bg: #FBEAE2;
  --orange-border: #F0C7B2;
  --orange-error-text: #9C3D1F;
  --gold: #F3D98A;
  --hero-copy: #E7EFE3;
  --border-neutral: #E4DDD0;
  --border-neutral-2: #F0EAE0;
  --footer-bg: #2A2420;
  --footer-text: #D8D0C2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
}

h1, h2, .font-heading {
  font-family: 'Poppins', sans-serif;
}

::selection { background: var(--orange); color: #fff; }

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes tugSway {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-14px); }
}
@keyframes tugSwayR {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(14px); }
}
@keyframes ropeSag {
  0%, 100% { d: path('M 10 100 Q 120 130 210 100'); }
  50% { d: path('M 10 100 Q 120 108 210 100'); }
}

/* HERO */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--green-dark) 0%, var(--green-light) 100%);
  padding: 40px 20px 56px;
  overflow: hidden;
}

.hero-logo {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
}

.hero-logo img {
  display: block;
  height: 22px;
  width: auto;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  padding: 7px 18px;
  border-radius: 999px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 2px;
  font-size: 12px;
}

.hero-title {
  font-weight: 800;
  font-size: clamp(36px, 10vw, 76px);
  line-height: 1.02;
  margin: 0;
  color: #fff;
}

.hero-title .accent { color: var(--orange); }

.hero-subtitle {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 4vw, 30px);
  color: var(--gold);
  letter-spacing: 4px;
  margin-top: -6px;
}

.hero-copy {
  font-size: 16px;
  color: var(--hero-copy);
  max-width: 640px;
  margin: 0;
  font-weight: 500;
}

.hero-copy strong { color: var(--gold); }

.hero-cta-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.tug-figures {
  width: 80px;
  height: 58px;
  opacity: 0.6;
  pointer-events: none;
  display: none;
}

.tug-figures.flip { transform: scaleX(-1); }

.tug-figure { animation: tugSway 3.2s ease-in-out infinite; transform-origin: 40px 160px; }
.tug-figures .rope { animation: ropeSag 3.2s ease-in-out infinite; }

.btn-cta {
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(226, 96, 58, 0.35);
  white-space: nowrap;
}

/* STAT STRIP */
.stat-strip {
  max-width: 1100px;
  margin: -30px auto 0;
  padding: 0 16px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.stat-card {
  padding: 18px 12px;
  text-align: center;
  border-right: 1px solid var(--border-neutral-2);
  border-bottom: 1px solid var(--border-neutral-2);
}

.stat-card:nth-child(2n) { border-right: none; }

.stat-label {
  font-size: 12px;
  color: var(--text-muted-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  margin-top: 4px;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.section { padding: 40px 0 8px; }

.section-title {
  font-weight: 700;
  font-size: 26px;
  text-align: center;
  margin: 0 0 8px;
  color: var(--text);
}

.section-copy {
  text-align: center;
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 15px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* CATEGORIES */
.categories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.rules-link-row {
  text-align: center;
  margin-top: 18px;
}

.rules-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid var(--border-neutral);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
}

.rules-link:hover { border-color: var(--orange); color: var(--orange); }

.category-card {
  border-radius: 16px;
  padding: 22px;
  border: 1px solid;
}

.category-card.mens { background: var(--green-bg); border-color: var(--green-border); }
.category-card.womens { background: var(--orange-bg); border-color: var(--orange-border); }

.category-pill {
  display: inline-block;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 999px;
}

.category-card.mens .category-pill { background: var(--green-dark); }
.category-card.womens .category-pill { background: var(--orange); }

.category-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.category-stat-label {
  font-size: 12px;
  font-weight: 600;
}

.category-card.mens .category-stat-label { color: #5B6B54; }
.category-card.womens .category-stat-label { color: #8A5B44; }

.category-stat-value {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 28px;
}

.category-card.mens .category-stat-value { color: var(--green-dark); }
.category-card.womens .category-stat-value { color: var(--orange); }

.category-stat-value .unit { font-size: 14px; font-weight: 600; }

/* DATES */
.dates-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.date-card {
  background: #fff;
  border: 1px solid var(--border-neutral-2);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}

.date-label {
  font-size: 12px;
  color: var(--text-muted-2);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.date-value {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin-top: 6px;
}

/* REGISTRATION FORM */
.register-section { padding-bottom: 60px; }

.form-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.07);
  padding: 24px;
  max-width: 720px;
  margin: 24px auto 0;
}

.form-title {
  font-weight: 700;
  font-size: 22px;
  margin: 0 0 4px;
  color: var(--text);
}

.form-subtitle {
  color: var(--text-muted);
  margin: 0 0 20px;
  font-size: 14px;
}

label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin: 16px 0 8px;
}

input[type="text"],
input[type="tel"],
input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 13px;
  border: 1.5px solid var(--border-neutral);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  background: #fffefb;
}

input:focus { border-color: var(--orange); }

.field-grid { display: flex; flex-direction: column-reverse; gap: 4px; }
.field-grid-logo { display: flex; flex-direction: column; align-items: center; }
.field-grid-logo label { align-self: flex-start; }

.logo-dropzone {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  border: 1.5px dashed var(--border-neutral);
  background: #fffefb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  color: var(--text-muted-2);
  font-size: 12px;
  text-align: center;
}

.logo-dropzone.drag-over { border-color: var(--orange); background: var(--orange-bg); }
.logo-dropzone img { width: 100%; height: 100%; object-fit: cover; }

.category-toggle {
  display: flex;
  gap: 10px;
}

.category-pill-option {
  flex: 1;
  cursor: pointer;
  text-align: center;
  padding: 13px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  border: 2px solid var(--border-neutral);
  background: #fff;
  color: var(--text-muted-2);
}

.category-pill-option.mens.selected { border-color: var(--green-dark); background: var(--green-bg); color: var(--green-dark); }
.category-pill-option.womens.selected { border-color: var(--orange); background: var(--orange-bg); color: var(--orange); }

.members-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 22px;
}

.hint-inline { font-weight: 400; color: var(--text-muted-2); }

.weight-readout {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.weight-readout.over { color: var(--orange); }

.weight-warning {
  background: var(--orange-bg);
  border: 1px solid var(--orange);
  color: var(--orange-error-text);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 8px;
  margin: 10px 0;
}

.member-row {
  display: grid;
  grid-template-columns: 24px 1fr 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.member-num { font-weight: 700; color: #B0A692; font-size: 14px; }

.member-row .member-remove {
  cursor: pointer;
  color: var(--orange-error-text);
  background: var(--orange-bg);
  border: 1px solid var(--orange-error-text);
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
}

.member-row input {
  padding: 10px 11px;
  font-size: 15px;
}

.name-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.name-row > div { margin-bottom: 0; }

.btn-add-member {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green-dark);
  font-weight: 700;
  font-size: 14px;
  margin-top: 4px;
  background: none;
  border: none;
  padding: 6px 0;
}

.btn-add-member:disabled { opacity: 0.5; cursor: not-allowed; }

.error-text {
  font-size: 13px;
  color: var(--orange-error-text);
  margin-top: 4px;
  min-height: 1em;
}

#formStatus {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}

#formStatus.error {
  display: block;
  background: var(--orange-bg);
  border: 1px solid var(--orange);
  color: var(--orange-error-text);
}

.btn-primary {
  display: block;
  width: 100%;
  cursor: pointer;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  padding: 15px;
  border-radius: 10px;
  border: none;
  box-shadow: 0 8px 20px rgba(226, 96, 58, 0.3);
  margin-top: 20px;
}

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

/* CONFIRMATION */
.confirm-card { text-align: center; animation: popIn 0.4s ease; }

.confirm-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green-dark);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.receipt-card {
  border: 1.5px dashed var(--border-neutral);
  border-radius: 14px;
  padding: 20px;
  text-align: left;
  background: var(--bg);
  margin-top: 20px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.receipt-row:last-child { margin-bottom: 0; }
.receipt-row span:first-child { color: var(--text-muted-2); }
.receipt-row span:last-child { font-weight: 600; }

.receipt-id-row {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-neutral);
}

.receipt-id-row span:first-child { font-size: 12px; font-weight: 600; color: var(--text-muted-2); }
.receipt-id-row span:last-child { font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--orange); }

.qr-card {
  border: 1px solid var(--border-neutral-2);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  background: #fff;
  margin-top: 20px;
}

.qr-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 14px;
}

.qr-canvas-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.qr-canvas-wrap img {
  border-radius: 8px;
  border: 1px solid var(--border-neutral-2);
}

.qr-meta {
  text-align: left;
  max-width: 320px;
  margin: 0 auto;
}

.qr-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.qr-meta-row span:first-child { color: var(--text-muted-2); }
.qr-meta-row span:last-child { font-weight: 600; word-break: break-all; text-align: right; }

.qr-hint {
  font-size: 12px;
  color: var(--text-muted-2);
  margin: 14px 0 0;
}

.register-another {
  margin-top: 20px;
  cursor: pointer;
  color: var(--green-dark);
  font-weight: 700;
  font-size: 14px;
}

/* FOOTER */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  margin-top: 40px;
}

.footer-title { font-weight: 700; color: var(--gold); margin-bottom: 6px; }
.site-footer a { color: var(--orange); }

/* RESPONSIVE */
@media (min-width: 640px) {
  .stat-strip { grid-template-columns: repeat(4, 1fr); }
  .stat-card:nth-child(2n) { border-right: 1px solid var(--border-neutral-2); }
  .stat-card:nth-child(4n) { border-right: none; }
  .stat-card { border-bottom: none; }

  .categories-grid { grid-template-columns: 1fr 1fr; }
  .dates-grid { grid-template-columns: repeat(3, 1fr); }

  .tug-figures { display: block; }

  .field-grid { flex-direction: row; }
  .field-grid-main { flex: 1; }

  .member-row { grid-template-columns: 28px 1fr 36px; }

  .name-row { grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
}

@media (min-width: 900px) {
  .hero { padding: 56px 24px 72px; }
  .section { padding: 56px 0 8px; }
  .form-card { padding: 40px; }
  .hero-logo { top: 24px; right: 24px; padding: 10px 16px; }
  .hero-logo img { height: 30px; }
}
