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

:root {
  --blue: #1087E5;
  --blue-dark: #0d6ebd;
  --blue-light: #e8f4fd;
  --blue-border: #bde0fa;
  --blue-disabled: #7BC4FF;
  --text: #0F1A23;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f5f8fb;
  --card-bg: #fff;
  --radius: 12px;
  --red: #dc2626;
  --red-light: #fef2f2;
  --red-border: #fecaca;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --green-border: #bbf7d0;
  --amber: #d97706;
  --amber-light: #fffbeb;
  --amber-border: #fde68a;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── Login page (index.html) ─────────────────────────────────────────────── */
body.login-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.logo-wrap { margin-bottom: 24px; display: flex; justify-content: center; }
.logo-wrap img { max-width: 280px; height: auto; }
.page-title { font-size: 26px; font-weight: 800; color: #0f172a; text-align: center; margin-bottom: 8px; line-height: 1.25; max-width: 400px; }
.page-sub   { font-size: 15px; color: var(--text-muted); text-align: center; margin-bottom: 32px; line-height: 1.5; max-width: 380px; }
.login-card {
  background: white; border-radius: 16px; padding: 32px; width: 100%; max-width: 460px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.04);
}
.login-card label { display: block; font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 8px; }
.login-card input[type="email"] {
  width: 100%; padding: 11px 14px; border: 1.5px solid #e0e4ef; border-radius: 8px;
  font-size: 15px; color: #0f172a; outline: none; transition: border-color .2s; font-family: inherit;
}
.login-card input[type="email"]::placeholder { color: #b0b7c3; }
.login-card input[type="email"]:focus { border-color: var(--blue); }
.btn-submit {
  width: 100%; margin-top: 14px; padding: 13px; background: var(--blue); color: white;
  border: none; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background .2s; font-family: inherit;
}
.btn-submit:hover:not(:disabled) { background: var(--blue-dark); }
.btn-submit:disabled { background: var(--blue-disabled); cursor: not-allowed; }
.message { margin-top: 18px; padding: 12px 14px; border-radius: 8px; font-size: 14px; line-height: 1.5; display: none; }
.message.success { background: var(--green-light); color: #166534; border: 1px solid var(--green-border); }
.message.error   { background: var(--red-light); color: #991b1b; border: 1px solid var(--red-border); }

/* ── Form page (form.html) ───────────────────────────────────────────────── */

/* Header */
.site-header {
  background: white; border-bottom: 1px solid var(--border); padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.site-header .brand img { height: 36px; width: auto; display: block; }
.btn-logout {
  background: none; border: 1.5px solid var(--border); border-radius: 8px; padding: 7px 14px;
  font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; font-family: inherit;
  transition: border-color .2s, color .2s;
}
.btn-logout:hover { border-color: var(--blue); color: var(--blue); }

/* Progress */
.progress-wrap {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 20px;
}
.progress-steps { display: flex; gap: 4px; margin-bottom: 8px; }
.progress-step { flex: 1; height: 5px; background: var(--border); border-radius: 3px; transition: background .3s; }
.progress-step.done   { background: var(--blue-dark); }
.progress-step.active { background: var(--blue); }
.progress-label { text-align: center; font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* Layout */
.main { max-width: 720px; margin: 32px auto; padding: 0 16px 80px; }

/* Card */
.card {
  background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 32px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.card-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.card-sub   { font-size: 14px; color: var(--text-muted); line-height: 1.65; margin-bottom: 28px; }

/* Info boxes */
.info-box {
  display: flex; gap: 10px; padding: 13px 16px; border-left: 3px solid var(--blue);
  background: var(--blue-light); border-radius: 0 8px 8px 0; font-size: 13px; color: #0a5fa3; line-height: 1.6;
}
.info-box .icon { flex-shrink: 0; }
.info-box ul { padding-left: 16px; margin-top: 4px; }
.info-box li { margin-bottom: 2px; }
.warn-box {
  display: flex; gap: 10px; padding: 13px 16px; border-left: 3px solid var(--amber);
  background: var(--amber-light); border-radius: 0 8px 8px 0; font-size: 13px; color: #78350f; line-height: 1.6;
}
.warn-box .icon { flex-shrink: 0; }
.success-box {
  display: flex; gap: 10px; padding: 13px 16px; border-left: 3px solid var(--green);
  background: var(--green-light); border-radius: 0 8px 8px 0; font-size: 13px; color: #166534; line-height: 1.6;
}

/* Fields */
.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: block; font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 8px; }
.field-sublabel { font-size: 12px; color: var(--text-muted); margin-top: -4px; margin-bottom: 8px; line-height: 1.5; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 15px; color: var(--text); font-family: inherit; outline: none;
  transition: border-color .2s; background: white;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); }
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.field-error { font-size: 12px; color: var(--red); margin-top: 4px; display: none; }
.field-error.visible { display: block; }

/* Toggle (Yes/No) */
.toggle-row { display: flex; gap: 10px; }
.toggle-btn {
  flex: 1; padding: 10px; border-radius: 8px; border: 1.5px solid var(--border);
  background: white; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .15s; text-align: center;
}
.toggle-btn:hover { border-color: var(--blue); color: var(--blue); }
.toggle-btn.active-yes { border-color: var(--green); background: var(--green-light); color: var(--green); }
.toggle-btn.active-no  { border-color: var(--red);   background: var(--red-light);   color: var(--red); }
.toggle-btn.active { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }
.cred-level-btn { padding:6px 18px; border:1.5px solid #d1d5db; border-radius:6px; background:#fff; font-size:14px; font-weight:500; cursor:pointer; transition:all .15s; }
.cred-level-btn:hover { border-color:var(--blue); color:var(--blue); }
.cred-level-btn.cred-active { border-color:var(--blue); background:var(--blue-light); color:var(--blue); }

/* Radio options */
.radio-option {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px;
  border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer;
  margin-bottom: 8px; transition: all .15s; user-select: none;
}
.radio-option:hover { border-color: var(--blue); background: var(--blue-light); }
.radio-option.selected { border-color: var(--blue); background: var(--blue-light); }
.radio-dot {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border);
  flex-shrink: 0; transition: all .15s; margin-top: 1px;
}
.radio-option.selected .radio-dot { border-color: var(--blue); background: var(--blue); }
.radio-label { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.5; }
.radio-desc  { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }

/* Checkbox options */
.checkbox-option {
  display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer;
  margin-bottom: 8px; transition: all .15s; user-select: none;
}
.checkbox-option:hover { border-color: var(--blue); }
.checkbox-option.selected { border-color: var(--blue); background: var(--blue-light); }
.checkbox-box {
  width: 18px; height: 18px; border-radius: 4px; border: 2px solid var(--border);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: all .15s; margin-top: 1px; font-size: 12px;
}
.checkbox-option.selected .checkbox-box { border-color: var(--blue); background: var(--blue); color: white; }
.checkbox-label { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.4; }

/* Subject tags */
.subject-tags { display: flex; flex-wrap: wrap; gap: 8px; min-height: 36px; margin-bottom: 12px; }
.subject-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  background: var(--blue-light); border: 1px solid var(--blue-border); border-radius: 20px;
  font-size: 13px; font-weight: 600; color: #0a5fa3;
}
.subject-tag .remove-btn {
  background: none; border: none; cursor: pointer; color: var(--blue); font-size: 14px;
  line-height: 1; padding: 0; display: flex; align-items: center; opacity: 0.6; transition: opacity .15s;
}
.subject-tag .remove-btn:hover { opacity: 1; }
.add-subject-row { display: flex; gap: 8px; margin-top: 8px; }
.add-subject-row select { flex: 1; }
.btn-add {
  padding: 10px 16px; background: var(--blue); color: white; border: none;
  border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: background .15s;
}
.btn-add:hover { background: var(--blue-dark); }
.empty-tag-msg { font-size: 13px; color: var(--text-muted); font-style: italic; padding: 4px 0; }

/* Nav */
.nav-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--border);
}
.btn-back {
  padding: 11px 22px; border: 1.5px solid var(--border); border-radius: 8px;
  background: white; font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: inherit; color: var(--text-muted); transition: all .15s;
}
.btn-back:hover { border-color: var(--blue); color: var(--blue); }
.btn-next {
  padding: 11px 28px; border: none; border-radius: 8px; background: var(--blue);
  color: white; font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: background .15s;
}
.btn-next:hover   { background: var(--blue-dark); }
.btn-next:disabled { background: var(--blue-disabled); cursor: not-allowed; }
.btn-submit-final {
  padding: 11px 30px; border: none; border-radius: 8px; background: var(--green);
  color: white; font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: background .15s;
}
.btn-submit-final:hover    { background: #15803d; }
.btn-submit-final:disabled { background: #86efac; cursor: not-allowed; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* File upload */
.file-upload-area {
  border: 2px dashed var(--border); border-radius: 8px; padding: 24px;
  text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
}
.file-upload-area:hover { border-color: var(--blue); background: var(--blue-light); }
.file-upload-area.has-file { border-color: var(--green); background: var(--green-light); border-style: solid; }
.file-upload-label { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.file-upload-label strong { color: var(--blue); cursor: pointer; }
.file-name { font-size: 13px; font-weight: 600; color: var(--green); margin-top: 8px; }
.upload-status { font-size: 13px; margin-top: 10px; }
.upload-status.uploading { color: var(--blue); }
.upload-status.success { color: var(--green); }
.upload-status.error { color: var(--red); }

/* Success screen */
.success-screen { text-align: center; padding: 56px 32px; }
.success-icon  { font-size: 60px; margin-bottom: 20px; }
.success-title { font-size: 26px; font-weight: 800; margin-bottom: 12px; }
.success-msg   { font-size: 16px; color: var(--text-muted); line-height: 1.65; max-width: 460px; margin: 0 auto; }

/* Loading */
.loading { text-align: center; padding: 80px 24px; color: var(--text-muted); font-size: 15px; }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--blue-border); border-top-color: var(--blue);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* Opt-in info text (used by the "Opt-in for TIBT" step) */
.opt-in-info { font-size: 13px; color: var(--text-muted); line-height: 1.75; margin-bottom: 16px; }
.opt-in-info ul { padding-left: 20px; margin-top: 8px; }
.opt-in-info li { margin-bottom: 6px; }
.opt-in-info strong { color: var(--text); }

/* Sub-section indent */
.sub-section {
  margin-top: 16px; padding: 18px 20px; background: #f8fafc;
  border: 1px solid var(--border); border-radius: 8px;
}
.sub-section-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px; }

/* Bio review panel */
.bio-review-badge { font-weight: 700; font-size: 13px; text-transform: uppercase; }

@media (max-width: 520px) {
  .card { padding: 20px 16px; }
  .toggle-row { flex-direction: column; }
}

/* Wise recommendation modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,26,35,.6);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  background: white; border-radius: 16px; padding: 36px 32px;
  max-width: 540px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,.25);
}
.modal-icon { font-size: 36px; margin-bottom: 12px; }
.modal-title { font-size: 21px; font-weight: 800; color: var(--text); margin-bottom: 14px; }
.modal-body { font-size: 14px; color: var(--text-muted); line-height: 1.75; margin-bottom: 26px; }
.modal-btn-stay {
  width: 100%; padding: 13px; border: none; border-radius: 8px;
  background: var(--blue); color: white; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: background .15s; margin-bottom: 10px; display: block;
}
.modal-btn-stay:hover { background: var(--blue-dark); }

/* Google Places autocomplete dropdown — must sit above all form layers */
.pac-container { z-index: 10000 !important; }
