:root {
  --navy: #1b1f2b;
  --red: #e63946;
  --red-dark: #c62838;
  --paper: #ffffff;
  --ink: #1b1f2b;
  --muted: #6b7280;
  --line: #d7dae0;
  --field-bg: #fbfbfc;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background: #ececef;
}

h1, h2, h3, .brand-name {
  font-family: 'Poppins', sans-serif;
}

/* ---------- Top Bar ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--navy);
  padding: 22px 40px;
  position: relative;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 2;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 1px;
}

.brand-sub {
  color: var(--red);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 1px;
}

.brand-sub strong { color: var(--red); }

.contact-block {
  background: var(--red);
  padding: 14px 28px;
  clip-path: polygon(14% 0, 100% 0, 100% 100%, 0% 100%);
  color: #fff;
  text-align: right;
  z-index: 2;
}

.contact-label {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
}

.contact-number {
  margin: 2px 0;
  font-weight: 700;
  font-size: 15px;
}

/* ---------- Sheet / Form Container ---------- */
.sheet {
  max-width: 900px;
  margin: 24px auto 40px;
  background: var(--paper);
  padding: 32px 44px 40px;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px solid var(--navy);
  padding-bottom: 18px;
  margin-bottom: 24px;
}

.title-row h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 800;
}

.title-dark { color: var(--navy); }
.title-accent { color: var(--red); }

.reg-date {
  text-align: right;
}

.reg-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--navy);
  margin-bottom: 8px;
}

.reg-date-value {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--field-bg);
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  letter-spacing: 0.5px;
}

/* ---------- Sections ---------- */
.form-section { margin-bottom: 30px; }

.form-section h2, .rules-section h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--navy);
  text-underline-offset: 5px;
  margin: 0 0 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.photo-box {
  flex-shrink: 0;
  width: 130px;
  height: 130px;
  border: 2px dashed var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  margin-top: -4px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color .15s, background .15s;
}

.photo-box:hover,
.photo-box:focus-visible {
  border-color: var(--red);
  background: #fff5f5;
}

.photo-box.has-image {
  border-style: solid;
}

.upload-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-box .upload-preview {
  border-radius: 4px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  flex: 1;
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

.field.full { grid-column: 1 / -1; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--navy);
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field-bg);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(230,57,70,0.15);
}

.dob-gender-wrap, .medium-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.dob-input { max-width: 200px; }

.gender-group, .medium-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gender-label { font-weight: 600; font-size: 14px; color: var(--navy); }

.radio-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.radio-pill input { accent-color: var(--red); width: 16px; height: 16px; }

.class-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex: 1;
  min-width: 180px;
}

.class-inline span { font-weight: 600; font-size: 14px; color: var(--navy); white-space: nowrap; }
.class-inline input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field-bg); }

/* ---------- Rules & Declaration ---------- */
.rules-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-bottom: 24px;
}

.rules-section ul {
  margin: 0 0 20px;
  padding-left: 20px;
  font-size: 14px;
  color: #333;
  line-height: 1.7;
}

.rules-section p {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  margin: 0 0 16px;
}

.declaration-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}

.declaration-check input { width: 17px; height: 17px; accent-color: var(--red); }

/* ---------- Signatures ---------- */
.signature-row {
  display: flex;
  justify-content: space-between;
  gap: 60px;
  margin: 34px 0 30px;
  padding: 0 20px;
}

.signature-box {
  flex: 1;
  text-align: center;
}

.sig-upload {
  height: 70px;
  border: 2px dashed var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color .15s, background .15s;
}

.sig-upload:hover,
.sig-upload:focus-visible {
  border-color: var(--red);
  background: #fff5f5;
}

.sig-upload.has-image {
  border-style: solid;
}

.sig-preview {
  object-fit: contain;
  padding: 4px;
}

.sig-placeholder {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.signature-box span {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

/* ---------- Submit ---------- */
.submit-row {
  text-align: center;
  margin-top: 10px;
}

#submitBtn {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 14px 42px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 30px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

#submitBtn:hover { background: var(--red-dark); }
#submitBtn:active { transform: scale(0.98); }
#submitBtn:disabled { opacity: 0.6; cursor: not-allowed; }

.form-message {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  min-height: 20px;
}

.form-message.success { color: #1a7f37; }
.form-message.error { color: var(--red); }

/* ---------- Bottom Bar ---------- */
.bottom-bar {
  background: var(--red);
  text-align: center;
  padding: 16px;
}

.bottom-bar p {
  margin: 0;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .top-bar { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
  .contact-block { clip-path: none; text-align: left; align-self: stretch; }
  .sheet { padding: 24px 20px; margin: 12px; }
  .title-row { flex-direction: column; gap: 14px; }
  .title-row h1 { font-size: 30px; }
  .reg-date { text-align: left; }
  .date-boxes { justify-content: flex-start; }
  .section-head { flex-direction: column; }
  .photo-box { align-self: center; }
  .two-col { grid-template-columns: 1fr; }
  .signature-row { flex-direction: column; gap: 24px; }
  .class-inline { margin-left: 0; }
}
