:root {
  --red: #D03027;
  --navy: #0D2137;
  --blue: #0A6E9E;
  --green: #1D7A4E;
  --amber: #B45309;
  --ink: #15202B;
  --muted: #57687A;
  --line: #D9E3EC;
  --wash: #F4F6F9;
  --paper: #FFFFFF;
  --radius: 4px;
  --shadow-md: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-lg: 0 18px 48px rgba(0,0,0,0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--ink);
  background: var(--wash);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, p { margin-top: 0; }

/* --- Header --- */
.enroll-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(16px, 5vw, 56px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--navy);
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 6px;
  color: white;
  background: linear-gradient(135deg, var(--navy), var(--red));
  font-weight: 900;
  font-size: 13px;
}

.enroll-header a {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
}

.enroll-header a:hover { text-decoration: underline; }

/* --- Page Layout --- */
.enroll-page {
  padding: clamp(28px, 5vw, 56px) clamp(16px, 5vw, 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* --- Step Indicator --- */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 560px;
  width: 100%;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
}

.step-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--line);
  z-index: 0;
}

.step-item.completed:not(:last-child)::after { background: var(--green); }
.step-item.active:not(:last-child)::after { background: var(--line); }

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--paper);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  position: relative;
  z-index: 1;
  transition: all 0.25s;
}

.step-item.active .step-circle {
  border-color: var(--red);
  background: var(--red);
  color: white;
}

.step-item.completed .step-circle {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.step-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.step-item.active .step-label { color: var(--red); }
.step-item.completed .step-label { color: var(--green); }

/* --- Enroll Card --- */
.enroll-card {
  width: min(100%, 560px);
  background: var(--paper);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  border: 1.5px solid var(--line);
  overflow: hidden;
}

.enroll-card-header {
  padding: 24px 28px 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.enroll-card-header h2 { margin-bottom: 4px; font-size: 22px; }
.enroll-card-header p { color: var(--muted); font-size: 14px; margin: 0; }

.step-panel {
  display: none;
  padding: 24px 28px;
  flex-direction: column;
  gap: 16px;
}

.step-panel.active { display: flex; }

/* --- Form Elements --- */
.field { display: flex; flex-direction: column; gap: 6px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

label {
  font-size: 13px;
  font-weight: 700;
  color: #33475e;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="password"],
input[type="file"],
select {
  height: 46px;
  padding: 0 12px;
  border: 1.5px solid #cdd8e2;
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

input[type="file"] {
  padding: 10px 12px;
  height: auto;
  min-height: 46px;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10,110,158,0.15);
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.field-error {
  font-size: 12px;
  color: var(--red);
  font-weight: 700;
  display: none;
}

.field-error.visible { display: block; }

.form-guidance {
  margin: 18px 28px 0;
  padding: 14px 16px;
  border: 1px solid #F5C2C0;
  border-left: 4px solid var(--red);
  border-radius: 6px;
  background: #FFF5F4;
  color: var(--ink);
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
}

.form-guidance[hidden] { display: none; }

.form-guidance-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #FFFFFF;
  background: var(--red);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.form-guidance strong {
  display: block;
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 14px;
}

.form-guidance p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

/* --- Password Strength --- */
.strength-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-top: 6px;
}

.strength-fill {
  height: 100%;
  border-radius: 999px;
  width: 0;
  transition: width 0.3s ease, background 0.3s ease;
}

.strength-fill.weak   { background: var(--red); width: 25%; }
.strength-fill.fair   { background: var(--amber); width: 50%; }
.strength-fill.good   { background: #3b82f6; width: 75%; }
.strength-fill.strong { background: var(--green); width: 100%; }

.strength-label {
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

.strength-label.weak   { color: var(--red); }
.strength-label.fair   { color: var(--amber); }
.strength-label.good   { color: #3b82f6; }
.strength-label.strong { color: var(--green); }

/* --- Card Footer / Buttons --- */
.enroll-card-footer {
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--wash);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-primary { color: white; background: var(--red); }
.btn-back { color: var(--muted); background: transparent; border: 1.5px solid var(--line); }
.btn-back:first-child:last-child { margin-left: auto; }

/* --- Review Summary --- */
.review-list { display: grid; gap: 10px; }

.review-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--wash);
  border: 1.5px solid var(--line);
  font-size: 14px;
}

.review-row strong { font-weight: 700; }
.review-row span { color: var(--muted); }

/* --- Disclosure --- */
.disclosure-box {
  padding: 16px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: var(--wash);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.disclosure-box strong { color: var(--ink); display: block; margin-bottom: 6px; font-size: 13px; }

/* --- Success State --- */
.enroll-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 28px;
  gap: 16px;
}

.enroll-success.active { display: flex; }

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e6f4ec;
  display: grid;
  place-items: center;
  font-size: 34px;
}

.enroll-success h2 { font-size: 26px; margin-bottom: 4px; }
.enroll-success p { color: var(--muted); max-width: 380px; line-height: 1.6; }

/* --- FDIC Footer --- */
.enroll-footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.6;
}

/* --- Custom country/phone select --- */
.nb-select {
  position: relative;
  width: 100%;
}

.nb-select-trigger {
  width: 100%;
  height: 46px;
  padding: 0 36px 0 12px;   /* right padding reserves space for the arrow */
  border: 1.5px solid #cdd8e2;
  border-radius: var(--radius);
  background: var(--paper);
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

/* Chevron arrow pinned to the far right via ::after */
.nb-select-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s, top 0.2s;
  flex-shrink: 0;
  pointer-events: none;
}

.nb-select.open .nb-select-trigger::after {
  transform: translateY(-30%) rotate(225deg);
}

.nb-select-trigger:focus,
.nb-select.open .nb-select-trigger {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10,110,158,0.15);
}

.nb-select-flag {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 22px;
  height: 16px;
  overflow: hidden;
}

.nb-select-flag img {
  display: block;
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
}

.nb-select-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.nb-select-dial {
  font-weight: 600;
  color: var(--ink);
  flex: 1;       /* pushes the ::after arrow to the far right */
}

/* hide the old JS-injected arrow span (kept for backwards compat) */
.nb-select-arrow { display: none; }

.nb-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(380px, 90vw);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.15);
  z-index: 600;
  display: none;
  flex-direction: column;
  max-height: 300px;
  overflow: hidden;
}

.nb-select.open .nb-select-dropdown { display: flex; }

.nb-select-search {
  padding: 10px 14px;
  border: none;
  border-bottom: 1.5px solid var(--line);
  font: inherit;
  font-size: 13px;
  outline: none;
  background: var(--wash);
  width: 100%;
  box-sizing: border-box;
}

.nb-select-empty {
  padding: 16px 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.nb-select-list {
  overflow-y: auto;
  flex: 1;
}

.nb-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}

.nb-select-option:hover { background: var(--wash); }
.nb-select-option.selected { background: #dbeafe; font-weight: 700; }

.nb-opt-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
}

.nb-opt-flag img {
  display: block;
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
}

.nb-opt-name { flex: 1; color: var(--ink); }
.nb-opt-dial { font-size: 12px; font-weight: 700; color: var(--muted); flex-shrink: 0; }

/* --- Phone composite --- */
.phone-field-row { grid-template-columns: 148px 1fr !important; }

/* --- State / City text-select label --- */
.nb-select-trigger .nb-select-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

@media (max-width: 540px) {
  .field-row { grid-template-columns: 1fr; }
  .step-label { display: none; }
  .enroll-card-footer { flex-direction: column-reverse; }
  .btn { width: 100%; }
}
