/* Registration — front-end only; aligns with request-form / portal tokens */
.reg-shell {
  --reg-primary: #0e7c3a;
  --reg-primary-dark: #0a5b2a;
  --reg-primary-light: #e8f5ee;
  --reg-ink: #0f172a;
  --reg-ink-soft: #475569;
  --reg-ink-mute: #64748b;
  --reg-border: #e2e8f0;
  --reg-border-strong: #cbd5e1;
  --reg-info-bg: #eff6ff;
  --reg-info-border: #bfdbfe;
  --reg-info-ink: #1e40af;
  --reg-danger: #b42318;
  --reg-radius: 10px;
  --reg-radius-lg: 14px;
  --reg-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--reg-ink);
  -webkit-font-smoothing: antialiased;
  background: #f0f4f8;
  background-image: radial-gradient(
      1200px 500px at 0% 0%,
      rgba(14, 124, 58, 0.08),
      transparent 55%
    ),
    radial-gradient(
      1000px 400px at 100% 100%,
      rgba(7, 0, 111, 0.06),
      transparent 50%
    );
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

.reg-shell * {
  box-sizing: border-box;
}

.reg-bg {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 14px 40px;
}

.reg-card {
  background: #fff;
  border: 1px solid var(--reg-border);
  border-radius: var(--reg-radius-lg);
  box-shadow: var(--reg-shadow);
  overflow: hidden;
}

.reg-header {
  text-align: center;
  padding: 28px 22px 22px;
  background: linear-gradient(180deg, #ffffff, var(--reg-primary-light));
  border-bottom: 1px solid var(--reg-border);
}

.reg-header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 12px;
  background: #fff;
  color: var(--reg-primary);
  font-size: 1.4rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(14, 124, 58, 0.12);
}

.reg-title {
  font-size: clamp(1.35rem, 3vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--reg-ink);
}

.reg-subtitle {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--reg-ink-soft);
  margin: 0;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

.reg-form {
  padding: 22px 20px 24px;
}

@media (min-width: 768px) {
  .reg-form {
    padding: 26px 32px 32px;
  }
}

/* Section groupings */
.reg-section {
  margin-bottom: 22px;
}

.reg-section:last-of-type {
  margin-bottom: 0;
}

.reg-section-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--reg-border);
}

.reg-section-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1rem;
}

.reg-section-icon--address {
  background: #eff6ff;
  color: #1d4ed8;
}

.reg-section-icon--birth {
  background: var(--reg-primary-light);
  color: var(--reg-primary-dark);
}

.reg-section-titles {
  flex: 1;
  min-width: 0;
}

.reg-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.3;
  color: var(--reg-ink);
}

.reg-section-desc {
  font-size: 0.8rem;
  color: var(--reg-ink-mute);
  line-height: 1.4;
  margin: 0;
}

.reg-row {
  --bs-gutter-x: 0.9rem;
  --bs-gutter-y: 0.9rem;
}

/* Fields — Bootstrap .form-control-lg / .form-select-lg scoped */
.reg-shell .form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--reg-ink);
  margin-bottom: 6px;
  line-height: 1.3;
}

.reg-shell .form-control-lg,
.reg-shell .form-select-lg {
  border: 1.5px solid var(--reg-border-strong);
  border-radius: 8px;
  font-size: 1rem;
  min-height: 48px;
  margin-bottom: 0;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  width: 100%;
}

.reg-shell .form-control-lg::placeholder,
.reg-shell .form-select-lg {
  color: #94a3b8;
}

.reg-shell .form-control-lg:hover:not(:focus),
.reg-shell .form-select-lg:hover:not(:focus) {
  border-color: #94a3b8;
}

.reg-shell .form-control-lg:focus,
.reg-shell .form-select-lg:focus {
  border-color: var(--reg-primary);
  box-shadow: 0 0 0 3px rgba(14, 124, 58, 0.2);
  background: #fff;
  outline: none;
}

.reg-field-msg {
  display: block;
  font-size: 0.75rem;
  line-height: 1.4;
  margin-top: 6px;
  min-height: 1.15em;
}

.reg-req {
  color: var(--reg-danger);
  font-weight: 700;
  margin-left: 1px;
}

/* Wrapped fields — affix icons, validation chrome */
.reg-field {
  margin-bottom: 4px;
}

.reg-input-affix {
  display: flex;
  align-items: stretch;
  border-radius: 8px;
  border: 1.5px solid var(--reg-border-strong);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

.reg-input-affix:hover:not(:focus-within) {
  border-color: #94a3b8;
}

.reg-input-affix:focus-within {
  border-color: var(--reg-primary);
  box-shadow: 0 0 0 3px rgba(14, 124, 58, 0.2);
  outline: none;
}

.reg-shell .reg-field--invalid .reg-input-affix:not(:focus-within) {
  border-color: var(--reg-danger);
}

.reg-shell .reg-field--valid-input .reg-input-affix:not(:focus-within) {
  border-color: #059669;
}

.reg-input-affix__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px 0 14px;
  flex-shrink: 0;
  color: var(--reg-ink-mute);
  font-size: 1.05rem;
  border-right: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.9);
}

.reg-shell .reg-input-affix__control.form-control-lg {
  border-radius: 0;
  border: none !important;
  flex: 1;
  min-width: 0;
  box-shadow: none !important;
}

.reg-shell .reg-input-affix__control.form-control-lg.is-valid,
.reg-shell .reg-input-affix__control.form-control-lg.is-invalid {
  background-image: none !important;
  padding-right: 12px !important;
}

.reg-shell .reg-field--shake {
  animation: reg-field-shake 0.45s ease-out;
}

@keyframes reg-field-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  15%,
  35%,
  55% {
    transform: translateX(-5px);
  }
  25%,
  45% {
    transform: translateX(5px);
  }
}

/* Password strength — segmented bar & checklist */
#password-help-block {
  margin-top: 12px;
}

.reg-field--empty .reg-pw-bar__seg {
  opacity: 0.42;
}

.reg-pw-bar {
  display: flex;
  gap: 5px;
  margin-bottom: 8px;
}

.reg-pw-bar__seg {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.35);
  transition: background 0.18s, opacity 0.18s, transform 0.18s;
}

.reg-field--empty .reg-pw-bar.reg-pw-bar--tier-none .reg-pw-bar__seg {
  opacity: 0.58;
}

.reg-pw-bar__seg.reg-pw-bar__seg--on {
  transform: scaleY(1.08);
}

.reg-pw-bar--tier-weak .reg-pw-bar__seg.reg-pw-bar__seg--on {
  background: linear-gradient(90deg, #dc2626, #ea580c);
}

.reg-pw-bar--tier-medium .reg-pw-bar__seg.reg-pw-bar__seg--on {
  background: linear-gradient(90deg, #d97706, #eab308);
}

.reg-pw-bar--tier-strong .reg-pw-bar__seg.reg-pw-bar__seg--on {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.reg-pw-strength-label {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}

.reg-pw-strength-label--empty {
  font-weight: 600;
  color: var(--reg-ink-mute);
}

.reg-pw-strength-label--weak {
  color: #991b1b;
}

.reg-pw-strength-label--medium {
  color: #a16207;
}

.reg-pw-strength-label--strong {
  color: var(--reg-primary-dark);
}

.reg-pw-checklist__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.7975rem;
  line-height: 1.5;
  margin-bottom: 4px;
  color: var(--reg-ink-soft);
}

.reg-pw-checklist__item:last-child {
  margin-bottom: 2px;
}

.reg-pw-checklist__bi {
  flex-shrink: 0;
  margin-top: 0.06em;
  font-size: 1rem;
  line-height: 1;
}

.reg-pw-checklist__item--neutral .reg-pw-checklist__bi,
.reg-pw-checklist__item--neutral .reg-pw-checklist__txt {
  color: #94a3b8;
}

.reg-pw-checklist__item--ok .reg-pw-checklist__bi {
  color: #059669;
}

.reg-pw-checklist__item--ok .reg-pw-checklist__txt {
  color: #065f46;
}

.reg-pw-checklist__item--fail .reg-pw-checklist__bi {
  color: var(--reg-danger);
}

.reg-pw-checklist__item--fail .reg-pw-checklist__txt {
  color: #991b1b;
}

.reg-field-feedback {
  display: block;
  margin-top: 8px;
  font-size: 0.7975rem;
  line-height: 1.45;
  font-weight: 600;
}

.reg-field-feedback__row {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
}

.reg-field-feedback__ico {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 1rem;
  line-height: 1;
}

.reg-field-feedback--success {
  color: #047857;
}

.reg-field-feedback--success .reg-field-feedback__ico {
  color: #059669;
}

.reg-field-feedback--error {
  color: var(--reg-danger);
}

.reg-field-feedback--error .reg-field-feedback__ico {
  color: #e11d48;
}

#emailWarning:empty,
#contactNumberWarning:empty,
#passwordMatch:empty {
  min-height: 0;
  margin: 0;
}

#emailWarning:not(:empty) {
  color: var(--reg-danger);
  font-weight: 500;
}

#contactNumberWarning:not(:empty):not(.reg-field-feedback--success) {
  color: inherit;
}

/* Policy */
.reg-policy {
  background: var(--reg-info-bg);
  border: 1px solid var(--reg-info-border);
  color: var(--reg-info-ink);
  border-radius: var(--reg-radius);
  padding: 14px 16px;
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0;
}

.reg-policy h3,
.reg-policy .reg-policy-heading {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--reg-info-ink);
}

.reg-policy p {
  margin: 0 0 0.5rem;
  color: #1e3a5f;
}

.reg-policy p:last-of-type,
.reg-policy p.mb-0 {
  margin-bottom: 0;
}

.reg-policy hr {
  border-color: rgba(30, 64, 175, 0.2);
  margin: 0.5rem 0 0.75rem;
  opacity: 1;
}

/* Submit */
.reg-btn-wrap {
  margin-top: 6px;
}

.reg-shell .reg-btn-primary {
  width: 100%;
  min-height: 50px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 20px;
  border: none;
  background: var(--reg-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(14, 124, 58, 0.25);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.reg-shell .reg-btn-primary:hover:not(:disabled) {
  background: var(--reg-primary-dark);
  box-shadow: 0 4px 14px rgba(14, 124, 58, 0.35);
}

.reg-shell .reg-btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.reg-shell .reg-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.reg-shell .reg-btn-primary:focus {
  outline: 2px solid var(--reg-primary);
  outline-offset: 2px;
}

.reg-foot {
  text-align: center;
  padding: 0 20px 28px;
  font-size: 0.9rem;
  color: var(--reg-ink-soft);
}

.reg-foot a {
  color: var(--reg-primary);
  font-weight: 600;
  text-decoration: none;
  margin-left: 2px;
}

.reg-foot a:hover {
  text-decoration: underline;
  color: var(--reg-primary-dark);
}

.reg-foot a:focus {
  outline: 2px solid var(--reg-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 576px) {
  .reg-form {
    padding: 18px 16px 22px;
  }
  .reg-header {
    padding: 24px 16px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reg-card,
  .reg-btn-primary,
  .reg-field--shake {
    transition: none;
    animation: none !important;
  }

  .reg-pw-bar__seg {
    transition: none !important;
    transform: none !important;
  }
}
