/* ==========================================================================
   National Pension Week 2026 — Modal Component System
   ========================================================================== */

:root {
  --modal-backdrop-bg: rgba(0, 0, 0, 0.55);
  --modal-surface: #ffffff;
  --modal-border: rgba(8, 61, 44, 0.14);
  --modal-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.35);
  --modal-radius: 16px;
}

.npw-modal-backdrop[hidden] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Backdrop */
.npw-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 32px);
  background: var(--modal-backdrop-bg);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  box-sizing: border-box;
  overscroll-behavior: contain;
}

.npw-modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

/* Modal Window */
.npw-modal-window {
  position: relative;
  width: 100%;
  max-width: min(540px, calc(100vw - 32px));
  max-height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
  background: var(--modal-surface);
  border-radius: var(--modal-radius);
  border: 1px solid var(--modal-border);
  box-shadow: var(--modal-shadow);
  transform: scale(0.96);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-x: hidden;
  overflow-y: hidden;
  box-sizing: border-box;
  margin: auto;
}

.npw-modal-window--large {
  max-width: min(620px, calc(100vw - 32px));
}

.npw-modal-backdrop.is-active .npw-modal-window {

  transform: scale(1) translateY(0);
}

/* Modal Header */
.npw-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid rgba(8, 61, 44, 0.08);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 2;
}

.npw-modal-header .eyebrow {
  margin-bottom: 4px;
  display: block;
}

.npw-modal-header h2 {
  margin: 0;
  font-family: var(--font-display, "Outfit", sans-serif);
  font-size: clamp(1.06rem, 1.8vw, 1.2rem);
  font-weight: 700;
  color: var(--green-950, #08291e);
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.npw-modal-desc {
  margin: 0 0 16px 0;
  color: #4b5563;
  font-size: 0.88rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.npw-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  border: 1px solid rgba(8, 61, 44, 0.12);
  background: rgba(8, 61, 44, 0.04);
  color: var(--green-950, #08291e);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.18s, border-color 0.18s;
  padding: 0;
}

.npw-modal-close:hover {
  background: rgba(8, 61, 44, 0.1);
  color: #000;
  transform: scale(1.06);
}

.npw-modal-close:focus-visible {
  outline: 3px solid var(--action-focus, #16a34a);
  outline-offset: 2px;
}

/* Modal Body */
.npw-modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
}

.npw-modal-body .preview-field {
  display: grid;
  gap: 7px;
  margin: 0 0 18px;
}

.npw-modal-body .preview-field label,
.npw-modal-body .preview-field legend {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--green-950, #08291e);
}

.npw-modal-body .preview-field input,
.npw-modal-body .preview-field select,
.npw-modal-body .preview-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1.5px solid #7d8b86;
  border-radius: 8px;
  background: #ffffff;
  color: #14231e;
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
}

.npw-modal-body .preview-field input:focus,
.npw-modal-body .preview-field select:focus,
.npw-modal-body .preview-field textarea:focus {
  border-color: var(--green-700, #15803d);
  outline: none;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.18);
}

/* Phone Input with Country Code Dropdown */
.npw-phone-input-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
}

.npw-country-code-select {
  width: 135px;
  min-width: 120px;
  max-width: 150px;
  flex: 0 0 135px;
  min-height: 46px;
  padding: 10px 10px;
  border: 1.5px solid #7d8b86;
  border-radius: 8px;
  background: #f8fafc;
  color: #14231e;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.npw-country-code-select:focus {
  border-color: var(--green-700, #15803d);
  outline: none;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.18);
}

.npw-phone-input-group input[type="tel"] {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 480px) {
  .npw-country-code-select {
    width: 115px;
    min-width: 110px;
    flex: 0 0 115px;
    font-size: 0.84rem;
    padding: 8px 6px;
  }
}

.npw-modal-body .preview-field textarea {
  min-height: 100px;
  resize: vertical;
}

.npw-modal-body .preview-check {
  margin: 18px 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #374151;
}

.npw-modal-body .preview-check label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.npw-modal-body .preview-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 18px;
  cursor: pointer;
  accent-color: var(--green-700, #15803d);
}

.npw-modal-body .form-error {
  color: #dc2626;
  font-size: 12.5px;
  font-weight: 600;
  margin: 4px 0 0;
  min-height: 16px;
}

.npw-modal-body .form-error:empty {
  display: none;
}

/* Social Media Profiles Section */
.preview-social-section {
  margin: 0 0 18px;
}

.preview-section-title {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--green-950, #08291e);
  margin-bottom: 8px;
}

.preview-field-optional {
  font-weight: 400;
  font-size: 0.84em;
  color: #6b7280;
  margin-left: 4px;
}

.preview-social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}

@media (max-width: 600px) {
  .preview-social-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.preview-social-grid .preview-field {
  margin: 0 !important;
  display: grid;
  gap: 6px;
}

.preview-social-grid .preview-field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
}

.preview-social-grid .preview-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #7d8b86;
  border-radius: 6px;
  background: #ffffff;
  color: #14231e;
  font: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.preview-social-grid .preview-field input:focus {
  border-color: var(--green-700, #15803d);
  outline: none;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.18);
}

.preview-form-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.preview-form-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.preview-form-section-header {
  margin-bottom: 14px;
}

.preview-form-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-950, #08291e);
  margin: 0 0 4px;
  font-family: var(--font-display, "Outfit", sans-serif);
}

.preview-form-section-desc {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}

.npw-modal-body form {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.npw-modal-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  width: 100%;
  box-sizing: border-box;
}

.npw-modal-form-actions .btn {
  width: auto;
  min-width: 130px;
  min-height: 42px;
  padding: 10px 22px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 8px;
  box-sizing: border-box;
  white-space: nowrap;
  cursor: pointer;
}

.npw-modal-form-actions .btn-modal-submit {
  background: var(--green-700, #15803d) !important;
  color: #ffffff !important;
  border-color: var(--green-700, #15803d) !important;
  box-shadow: 0 4px 14px rgba(21, 128, 61, 0.25);
}

.npw-modal-form-actions .btn-modal-submit:hover {
  background: var(--green-800, #166534) !important;
  border-color: var(--green-800, #166534) !important;
}

.npw-modal-form-actions .btn-modal-cancel {
  background: transparent !important;
  color: #4b5563 !important;
  border: 1px solid #d1d5db !important;
  box-shadow: none !important;
}

.npw-modal-form-actions .btn-modal-cancel:hover {
  background: #f3f4f6 !important;
  color: #111827 !important;
  border-color: #9ca3af !important;
}

/* Modal Footer Note */
.npw-modal-footer-note {
  padding: 12px 28px;
  background: var(--surface-soft, #f4fbf7);
  border-top: 1px solid rgba(8, 61, 44, 0.08);
  font-size: 0.78rem;
  color: var(--text-secondary, #4b5563);
  text-align: center;
}

/* Feedback Modals (Success & Error) */
.npw-feedback-window {
  max-width: 520px;
  text-align: center;
  padding: 36px 32px;
  align-items: center;
}

.npw-feedback-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
}

.npw-feedback-icon--success {
  background: #dcfce7;
  color: #15803d;
  box-shadow: 0 0 0 8px rgba(220, 252, 231, 0.4);
}

.npw-feedback-icon--error {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: 0 0 0 8px rgba(254, 226, 226, 0.4);
}

.npw-feedback-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.npw-feedback-badge--success {
  background: #e6f7ec;
  color: #14532d;
}

.npw-feedback-badge--error {
  background: #fef2f2;
  color: #991b1b;
}

.npw-feedback-window h2 {
  margin: 0 0 8px;
  font-family: var(--font-display, "Outfit", sans-serif);
  font-size: clamp(1.12rem, 1.8vw, 1.28rem);
  font-weight: 700;
  color: var(--green-950, #08291e);
  letter-spacing: -0.015em;
}

.npw-feedback-window p {
  margin: 0 0 20px;
  font-size: 0.96rem;
  color: #4b5563;
  line-height: 1.6;
}

/* Digital Pass Reference Card */
.npw-pass-card {
  width: 100%;
  background: #f8faf9;
  border: 1.5px dashed #16a34a;
  border-radius: 12px;
  padding: 18px 20px;
  margin: 12px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}

.npw-pass-kicker {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #15803d;
}

.npw-pass-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.7rem;
  font-weight: 900;
  color: #0b2f24;
  letter-spacing: 0.04em;
}

.npw-pass-event {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
}

/* Feedback Actions */
.npw-feedback-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.npw-feedback-actions .btn {
  flex: 1;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

/* Body scroll lock */
body.npw-modal-open {
  overflow: hidden;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .npw-modal-backdrop {
    padding: 12px 10px;
    align-items: center;
  }

  .npw-modal-window {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 14px;
    transform: scale(0.98);
  }

  .npw-modal-backdrop.is-active .npw-modal-window {
    transform: scale(1);
  }

  .npw-modal-header {
    padding: 16px 18px 12px;
  }

  .npw-modal-header h2 {
    font-size: 1.12rem;
  }

  .npw-modal-body {
    padding: 16px 18px 20px;
  }

  .npw-modal-body .preview-field {
    margin: 0 0 14px;
  }

  .npw-modal-body .preview-field input,
  .npw-modal-body .preview-field select,
  .npw-modal-body .preview-field textarea {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px; /* Prevents auto-zoom on mobile browsers */
  }

  .npw-modal-form-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px !important;
    margin-top: 20px;
    width: 100%;
  }

  .npw-modal-form-actions .btn {
    width: 100% !important;
    min-width: 100% !important;
    min-height: 44px;
    padding: 10px 16px;
    font-size: 0.92rem;
    justify-content: center;
  }

  .npw-feedback-window {
    padding: 24px 18px;
    border-radius: 14px;
  }

  .npw-feedback-actions {
    flex-direction: column;
    gap: 10px;
  }

  .npw-feedback-actions .btn {
    width: 100% !important;
  }
}



.npw-error-box {
  background: #fef2f2;
  border-left: 4px solid #dc2626;
  padding: 14px 18px;
  border-radius: 8px;
  color: #991b1b;
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: left;
  margin: 14px 0 18px;
}

.npw-error-instruction {
  font-size: 0.88rem;
  color: #6b7280;
  margin-bottom: 20px;
}

/* Explicit green hero button with white text */
#hero-register-btn,
.interior-hero-actions #hero-register-btn,
.participation-bg-hero #hero-register-btn {
  background: #15803d !important;
  border-color: #15803d !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16) !important;
  text-shadow: none !important;
}

#hero-register-btn:hover,
.interior-hero-actions #hero-register-btn:hover,
.participation-bg-hero #hero-register-btn:hover {
  background: #166534 !important;
  border-color: #166534 !important;
  color: #ffffff !important;
}

/* Multi-step Wizard */
.npw-wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 220px;
  margin: 18px auto 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.npw-wizard-pill {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  border: 1.5px solid transparent;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  line-height: 1;
}

.npw-wizard-pill:hover {
  background: #e5e7eb;
  color: #374151;
  transform: scale(1.06);
}

.npw-wizard-pill:focus-visible {
  outline: 3px solid var(--action-focus, #16a34a);
  outline-offset: 2px;
}

.npw-wizard-pill.is-active {
  background: #15803d;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.2);
}

.npw-wizard-pill.is-done {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.npw-wizard-divider {
  flex: 1;
  height: 2px;
  background: #e5e7eb;
}

.npw-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px;
  font-family: var(--font-display, "Outfit", sans-serif);
}

.npw-wizard-step {
  animation: npwFadeIn 0.22s ease-out;
}

.npw-wizard-step[hidden] {
  display: none !important;
}

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

/* WhatsApp Sub-checkbox under phone */
.preview-whatsapp-opt {
  margin-top: 6px;
  padding-left: 2px;
}

.preview-whatsapp-opt label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
}

.preview-whatsapp-opt input[type="checkbox"] {
  width: 17px !important;
  height: 17px !important;
  min-height: 17px !important;
  accent-color: #15803d;
  margin: 0;
  cursor: pointer;
}

fieldset.preview-field {
  border: 0;
  padding: 0;
  margin: 0 0 14px 0;
}

/* Age Options Grid */
.npw-age-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.npw-age-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.18s, background-color 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
}

.npw-age-card:hover {
  border-color: #15803d;
  background: #f8faf9;
}

.npw-age-card.is-selected,
.npw-age-card:has(input:checked) {
  border-color: #15803d;
  background: #f0fdf4;
  box-shadow: 0 0 0 1px #15803d;
}

.npw-age-card input[type="radio"] {
  accent-color: #15803d;
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin-top: 2px;
  cursor: pointer;
}

.npw-age-card-label,
.npw-age-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1f2937;
  display: block;
  line-height: 1.3;
}

.npw-age-card-hint,
.npw-age-card-desc {
  font-size: 0.76rem;
  color: #6b7280;
  font-weight: normal;
  display: block;
  margin-top: 2px;
}

/* Privacy Acknowledgement link in checkboxes */
.preview-check a {
  color: #15803d;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  transition: color 0.15s;
}

.preview-check a:hover {
  color: #166534;
}

.npw-conditional-box {
  background: #f8faf9;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 16px 18px;
  margin: 14px 0 18px;
}

.npw-conditional-box-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: #15803d;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.npw-file-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .npw-wizard-progress {
    gap: 8px;
    max-width: 180px;
    margin-top: 14px;
  }
  .npw-wizard-pill {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    font-size: 0.82rem;
  }
  .npw-age-grid {
    grid-template-columns: 1fr;
  }
}
.preview-form-section {
  margin-top: 24px;
  margin-bottom: 12px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.preview-form-section:first-of-type {
  margin-top: 6px;
  padding-top: 0;
  border-top: none;
}

.preview-form-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-form-section-desc {
  font-size: 0.84rem;
  color: #6b7280;
  margin: 0 0 14px 0;
}
