/* Styra Wealth Management — Risk Questionnaire */

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

:root {
  --dark: #1a1f35;
  --dark-mid: #2d3748;
  --mid: #718096;
  --light-border: #e2e8f0;
  --bg: #f7f8fc;
  --white: #ffffff;
  --accent: #4a7fa8;
  --accent-hover: #3a6f98;
  --error: #c0392b;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--dark-mid);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ─── Header ── */
.site-header {
  background: var(--dark);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .firm-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.site-header .report-type {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─── Progress Bar ── */
.progress-bar-wrap {
  background: var(--dark);
  padding: 0 32px 16px;
}

.progress-steps {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.progress-step {
  height: 4px;
  flex: 1;
  border-radius: 99px;
  background: rgba(255,255,255,0.2);
  transition: background 0.3s;
}

.progress-step.active { background: var(--accent); }
.progress-step.complete { background: rgba(255,255,255,0.55); }

/* ─── Main Container ── */
.container {
  max-width: 680px;
  margin: 40px auto;
  padding: 0 20px 60px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 44px;
}

@media (max-width: 600px) {
  .card { padding: 28px 24px; }
  .container { margin: 20px auto; }
}

/* ─── Typography ── */
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--mid);
  margin-bottom: 32px;
  line-height: 1.6;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--light-border);
}

/* ─── Form Elements ── */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark-mid);
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="email"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--light-border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--dark-mid);
  background: var(--white);
  transition: border-color 0.2s;
  appearance: none;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,127,168,0.12);
}

.form-group input.error {
  border-color: var(--error);
}

.field-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 5px;
  display: none;
}

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

/* ─── Radio Questions ── */
.question-block {
  margin-bottom: 32px;
}

.question-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 14px;
  line-height: 1.5;
}

.question-number {
  display: inline-block;
  background: var(--dark);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  text-align: center;
  line-height: 22px;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

.radio-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--light-border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.radio-option:hover {
  border-color: var(--accent);
  background: #f0f7ff;
}

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

.radio-option input[type="radio"]:checked + .option-text {
  color: var(--dark);
  font-weight: 500;
}

.radio-option:has(input:checked) {
  border-color: var(--accent);
  background: #f0f7ff;
}

.option-text {
  font-size: 13.5px;
  color: #4a5568;
  line-height: 1.4;
}

.option-sub {
  display: block;
  font-size: 12px;
  color: var(--mid);
  margin-top: 2px;
}

/* ─── Portfolio Table ── */
.portfolio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 14px;
}

.portfolio-table th {
  text-align: left;
  padding: 8px 12px;
  background: #f7f8fc;
  color: var(--mid);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--light-border);
}

.portfolio-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--light-border);
  color: var(--dark-mid);
}

.portfolio-table td:first-child {
  font-weight: 600;
  color: var(--dark);
}

.portfolio-table tr:last-child td { border-bottom: none; }

/* ─── Textarea ── */
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--light-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--dark-mid);
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,127,168,0.12);
}

/* ─── Partner Toggle ── */
.toggle-group {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.toggle-btn {
  flex: 1;
  padding: 10px;
  border: 1.5px solid var(--light-border);
  border-radius: 6px;
  background: var(--white);
  font-size: 14px;
  font-weight: 500;
  color: var(--mid);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.toggle-btn.selected { border-color: var(--accent); background: #f0f7ff; color: var(--dark); font-weight: 600; }

.partner-fields {
  margin-top: 20px;
  padding: 20px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid var(--light-border);
  display: none;
}

.partner-fields.visible { display: block; }

/* ─── Submit Button ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: #a0aec0; cursor: not-allowed; }

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Results Page ── */
.profile-hero {
  text-align: center;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--light-border);
  margin-bottom: 28px;
}

.profile-hero .label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 8px;
}

.profile-hero .profile-name {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 16px;
}

.scores-row {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.score-pill {
  flex: 1;
  background: #f7f8fc;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  border: 1px solid var(--light-border);
}

.score-pill .pill-label {
  font-size: 11px;
  color: var(--mid);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.score-pill .pill-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
}

.score-pill .pill-sub {
  font-size: 11px;
  color: var(--mid);
}

.profile-description {
  font-size: 14px;
  line-height: 1.75;
  color: #4a5568;
  margin-bottom: 28px;
}

.alloc-note {
  font-size: 13px;
  background: #f0f7ff;
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: 3px;
  margin-bottom: 28px;
  color: var(--dark-mid);
}

.next-steps {
  background: #f9fafb;
  border-radius: 6px;
  padding: 20px 24px;
  font-size: 13px;
  color: #4a5568;
  line-height: 1.7;
}

.next-steps strong { color: var(--dark); display: block; margin-bottom: 6px; }

.check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: #e6f4ea;
  border-radius: 50%;
  margin: 0 auto 16px;
}

/* ─── Error Banner ── */
.error-banner {
  background: #fff5f5;
  border: 1px solid #feb2b2;
  color: var(--error);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 20px;
  display: none;
}

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

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