:root {
  --navy: #1B2A4A;
  --navy-dark: #0F1D36;
  --navy-light: #2C3E5C;
  --red: #D32F2F;
  --red-dark: #B71C1C;
  --red-light: #EF5350;
  --white: #FFFFFF;
  --bg: #F7F8FA;
  --card: #FFFFFF;
  --text: #1A1F36;
  --text-secondary: #5E6278;
  --text-muted: #9CA3AF;
  --border: #E2E5ED;
  --border-focus: #1B2A4A;
  --error: #EF4444;
  --success: #10B981;
  --font: 'Montserrat', system-ui, sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(27, 42, 74, 0.06);
  --shadow-md: 0 4px 12px rgba(27, 42, 74, 0.08);
  --shadow-lg: 0 8px 30px rgba(27, 42, 74, 0.12);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── HEADER ── */
.event-header {
  position: relative;
  padding: 2.5rem 1.5rem 4rem;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy), var(--navy-light));
  background-size: cover;
  background-position: center;
}

.header-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 29, 54, 0.92), rgba(27, 42, 74, 0.85));
  z-index: 1;
}

.header-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.header-logo {
  display: block;
  height: 48px;
  margin: 0 auto 1rem;
  filter: brightness(0) invert(1);
}

.header-badge {
  display: inline-block;
  background: rgba(211, 47, 47, 0.15);
  border: 1px solid rgba(211, 47, 47, 0.3);
  color: var(--red-light);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 5px 16px;
  border-radius: 50px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.header-content h1 {
  font-size: clamp(1.5rem, 4.5vw, 2.4rem);
  font-weight: 800;
  color: white;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.header-subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
}

/* ── STEPPER ── */
.stepper {
  max-width: 680px;
  margin: -1.25rem auto 1.5rem;
  padding: 0 1rem;
  position: relative;
  z-index: 10;
}

.stepper-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  position: absolute;
  top: 16px;
  left: 50px;
  right: 50px;
}

.stepper-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--red));
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.stepper-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.step-dot:hover span {
  border-color: var(--navy-light);
  transform: scale(1.08);
}

.step-dot span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card);
  border: 2.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.3s;
}

.step-dot.active span {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
  box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.15);
}

.step-dot.done span {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-dot small {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.step-dot.active small,
.step-dot.done small {
  color: var(--text);
}

/* ── FORM ── */
.container {
  max-width: 700px;
  width: 100%;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.registration-form {
  background: var(--card);
  padding: 2rem 2.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.form-step {
  display: none;
  animation: slideIn 0.35s ease;
}

.form-step.active {
  display: block;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-header {
  margin-bottom: 1.75rem;
}

.step-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.2rem;
}

.step-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── FIELDS ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row:has(> :only-child) {
  grid-template-columns: 1fr;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field label,
.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.req {
  color: var(--red);
  font-weight: 700;
}

.optional-tag {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.7rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
.styled-select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #FAFBFC;
  color: var(--text);
  transition: all 0.2s;
  appearance: none;
}

.styled-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235E6278' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 1.8rem;
  cursor: pointer;
}

input:focus,
.styled-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.08);
  background: white;
}

input::placeholder {
  color: var(--text-muted);
}

input.error-input {
  border-color: var(--error);
  background: #FEF2F2;
}

/* Phone */
.phone-input-group {
  display: flex;
}

.country-code-select {
  width: 105px;
  min-width: 105px;
  padding: 0.6rem 0.5rem;
  font-size: 0.84rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: #F3F4F6;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%235E6278' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 1rem;
}

.phone-input-group input[type="tel"] {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  flex: 1;
}

/* Divider */
.section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1.5rem 0 1.25rem;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-divider span {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--navy-light);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  white-space: nowrap;
}

/* ── SECTIONS ── */
.form-section {
  margin-bottom: 1.5rem;
}

/* ── CHECKBOX GRID ── */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px;
}

.checkbox-grid label,
.pill-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #FAFBFC;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}

.checkbox-grid label:hover,
.pill-group label:hover {
  border-color: var(--navy-light);
  background: #F0F2F8;
}

.checkbox-grid label:has(input:checked),
.pill-group label:has(input:checked) {
  border-color: var(--navy);
  background: rgba(27, 42, 74, 0.06);
  color: var(--navy);
}

.checkbox-grid input[type="checkbox"],
.pill-group input[type="checkbox"] {
  accent-color: var(--navy);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Radio */
.radio-pills {
  display: flex;
  gap: 8px;
}

.pill-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #FAFBFC;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.84rem;
  font-weight: 500;
}

.pill-radio:hover {
  border-color: var(--navy-light);
}

.pill-radio:has(input:checked) {
  border-color: var(--navy);
  background: rgba(27, 42, 74, 0.06);
  color: var(--navy);
}

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

/* ── CONSENT ── */
.consent-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 1.25rem 0;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #FAFBFC;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.consent-label:hover {
  border-color: var(--navy-light);
}

.consent-label:has(input:checked) {
  border-color: var(--success);
  background: #F0FDF4;
}

.consent-label input[type="checkbox"] {
  accent-color: var(--success);
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}

.consent-check {
  display: none;
}

/* Terms card */
.terms-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, #EEF2FF, #F0F4FF);
  border: 1px solid #CBD5E1;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 1.25rem;
}

.terms-icon {
  font-size: 1.3rem;
}

.terms-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── BUTTONS ── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2rem;
  gap: 10px;
}

.form-actions.space-between {
  justify-content: space-between;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--navy);
  color: white;
  box-shadow: 0 2px 8px rgba(27, 42, 74, 0.2);
}

.btn-primary:hover {
  background: var(--navy-dark);
  box-shadow: 0 4px 14px rgba(27, 42, 74, 0.25);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-submit {
  background: var(--red);
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.2);
}

.btn-submit:hover {
  background: var(--red-dark);
  box-shadow: 0 4px 14px rgba(211, 47, 47, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--text-secondary);
  color: var(--text);
}

/* ── ERROR ── */
.field-error {
  color: var(--error);
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 3px;
  display: none;
}

/* ── SUCCESS ── */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 29, 54, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.success-card {
  background: white;
  padding: 2rem 1.5rem;
  border-radius: 14px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  max-height: 94vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.5s ease;
}

.success-ring {
  width: 64px;
  height: 64px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.success-card h2 {
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
  color: var(--navy);
  border: none;
}

.success-card>p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.display-code {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 2px;
  background: rgba(27, 42, 74, 0.06);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin: 0.5rem 0;
}

.badge-preview-container {
  margin: 0.75rem auto;
  width: 180px;
  height: 270px;
  max-width: 100%;
  background: var(--navy);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

#badgePreviewCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-id-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: monospace;
  margin-top: 4px;
}

.small-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.badge-download-btn {
  margin-top: 1rem;
  width: 100%;
  justify-content: center;
}

/* ── COLLAPSIBLE CHECKBOX SECTIONS (mobile) ── */
.cb-count-badge {
  display: none;
}

.cb-chevron {
  display: none;
}

@media (max-width: 640px) {
  .collapsible-section .section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin: 0 -12px 0;
    border-radius: var(--radius-sm);
    background: #F8F9FB;
    border: 1.5px solid var(--border);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    width: calc(100% + 24px);
  }

  .collapsible-section .section-label .req {
    margin-right: auto;
  }

  .cb-count-badge {
    display: inline-flex;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    background: var(--border);
    color: var(--text-muted);
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .cb-count-badge.has-selection {
    background: rgba(27, 42, 74, 0.1);
    color: var(--navy);
  }

  .cb-chevron {
    display: inline-flex;
    flex-shrink: 0;
    transition: transform 0.25s ease;
    color: var(--text-muted);
  }

  .collapsible-section.expanded .cb-chevron {
    transform: rotate(180deg);
  }

  .collapsible-section .checkbox-grid,
  .collapsible-section .pill-group {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease, opacity 0.25s ease;
    opacity: 0;
    margin-top: 0;
  }

  .collapsible-section.expanded .checkbox-grid,
  .collapsible-section.expanded .pill-group {
    max-height: 2500px;
    opacity: 1;
    margin-top: 10px;
  }
}

.consent-text-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.truncate-text {
  transition: all 0.3s ease;
}

.read-more-btn {
  display: none;
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.read-more-btn:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .registration-form {
    padding: 1.25rem;
  }

  .event-header {
    padding: 2rem 1rem 3rem;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .stepper-track {
    left: 35px;
    right: 35px;
  }

  .step-dot small {
    font-size: 0.5rem;
    letter-spacing: 0;
  }

  .step-dot span {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  .radio-pills {
    flex-wrap: wrap;
  }

  .pill-radio {
    flex: 1;
    min-width: 0;
    justify-content: center;
  }

  .phone-input-group {
    flex-wrap: nowrap;
  }

  .country-code-select {
    width: 90px;
    min-width: 90px;
    font-size: 0.78rem;
    padding: 0.6rem 0.4rem;
  }

  .container {
    padding: 0 0.75rem;
  }

  .form-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .header-content h1 {
    font-size: 1.3rem;
  }

  .success-card {
    padding: 2rem 1.25rem;
  }

  .display-code {
    font-size: 1.2rem;
    padding: 6px 14px;
  }

  .terms-card {
    flex-direction: column;
    gap: 8px;
  }

  .consent-label {
    font-size: 0.78rem;
    padding: 10px 12px;
  }

  .truncate-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .truncate-text.expanded {
    -webkit-line-clamp: unset;
    line-clamp: unset;
  }

  .read-more-btn {
    display: inline-block;
  }

  .btn {
    padding: 10px 18px;
    font-size: 0.84rem;
  }
}