/*
 * Research Opinions / Healthcare Opinions registration pages.
 * One self-contained stylesheet: no web fonts, no CDNs, no theme files.
 *
 * Brand colours (taken from the existing emails):
 *   Research Opinions   navy #0F2542, blue #1CA9E1
 *   Healthcare Opinions black #000000, green #4CAF39
 * Pages add class="brand-hc" to <body> for Healthcare Opinions.
 */

:root {
  --brand-dark: #0F2542;
  --brand: #1CA9E1;
  --brand-hover: #1592C4;
  --brand-tint: #E8F6FC;
  --text: #2D2D2D;
  --muted: #626262;
  --line: #D9DEE3;
  --bg: #F4F4F4;
  --card: #FFFFFF;
  --danger: #B42318;
  --danger-tint: #FDECEA;
  --success: #1E7B34;
  --success-tint: #E7F5EA;
  --warning: #8A5A00;
  --warning-tint: #FFF6E0;
  --radius: 6px;
}

body.brand-hc {
  --brand-dark: #000000;
  --brand: #4CAF39;
  --brand-hover: #3E9530;
  --brand-tint: #EDF7EB;
}

/* ---------- Base ------------------------------------------------------ */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 12px; color: var(--text); }
h1 { font-size: 28px; }
h3, h4 { font-size: 20px; }
p { margin: 0 0 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
img { max-width: 100%; height: auto; }

/* ---------- Header and footer ---------------------------------------- */

.site-header { background: var(--brand-dark); }
.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px;
}
.wordmark {
  color: #FFFFFF;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
}
.wordmark span { color: var(--brand); }
.wordmark:hover { color: #FFFFFF; }

.site-footer {
  max-width: 1100px;
  margin: 32px auto 0;
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.site-footer a { color: var(--muted); }

/* ---------- Simple page container (survey login) --------------------- */

.page { max-width: 640px; margin: 32px auto; padding: 0 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card h1 { margin-bottom: 16px; }
.card .intro { color: var(--muted); margin-bottom: 20px; }
.card .divider { border-top: 1px solid var(--line); margin: 24px 0; }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 6px; }

/* ---------- Form controls (all pages) -------------------------------- */

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
select, textarea, .gui-input, .form-control {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #B8C0C8;
  border-radius: var(--radius);
  background: #FFFFFF;
  color: var(--text);
  font: inherit;
}
select { appearance: auto; }
textarea { min-height: 120px; }

.button, .btn, button, input[type="submit"] {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: var(--brand);
  color: #FFFFFF;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, .btn:hover, button:hover, input[type="submit"]:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #FFFFFF;
}
.btn-secondary, input[type="submit"].btn-secondary {
  background: #FFFFFF;
  color: var(--brand-dark);
  border-color: #B8C0C8;
}
.btn-secondary:hover, input[type="submit"].btn-secondary:hover {
  background: var(--brand-tint);
  color: var(--brand-dark);
  border-color: var(--brand);
}
.btn-block { display: block; width: 100%; }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: #17612A; border-color: #17612A; }

/* ---------- Smart-forms markup (profile questions pages) ------------- */

.smart-wrap { padding: 32px 16px; }
.smart-forms.smart-container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.form-header { background: var(--brand-dark); padding: 16px 24px; }
.form-header h4 { color: #FFFFFF; margin: 0; }
.form-header h4 i { display: none; }
.form-body { padding: 24px; }
.form-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.frm-row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.section { padding: 0 8px; margin-bottom: 16px; }
.colm { flex: 0 0 100%; max-width: 100%; }
@media (min-width: 720px) {
  .colm1 { flex-basis: 8.333%; max-width: 8.333%; }
  .colm2 { flex-basis: 16.666%; max-width: 16.666%; }
  .colm4 { flex-basis: 33.333%; max-width: 33.333%; }
  .colm6 { flex-basis: 50%; max-width: 50%; }
  .colm12 { flex-basis: 100%; max-width: 100%; }
}

.field-label { display: block; font-weight: 700; margin-bottom: 6px; }
.field { display: block; position: relative; }
.field-icon, .arrow { display: none; }

/* Checkbox rows */
.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-weight: 400;
  cursor: pointer;
}
.option input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; }
.option .checkbox { display: none; }
.small-text { font-size: 14px; }
.fine-grey { color: var(--muted); }
.title { font-size: 20px; }
.spacer-b25 { height: 25px; }

/* Validation messages */
.field.state-error .gui-input, .field.state-error select { border-color: var(--danger); background: var(--danger-tint); }
.field.state-success .gui-input, .field.state-success select { border-color: var(--success); }
.notification.alert-error {
  background: var(--danger-tint);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
  padding: 12px 16px;
}
.notification.alert-error p { margin: 0 0 6px; font-weight: 700; }
#smartErrors { margin: 0; padding-left: 20px; }
#smartErrors err { display: list-item; list-style: none; }
#loginfailed { color: var(--danger); font-weight: 700; margin-bottom: 12px; }

/* "Please wait" box shown on Next */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.45);
  overflow: auto;
}
.modal-content {
  max-width: 420px;
  margin: 15vh auto 0;
  padding: 28px;
  background: #FFFFFF;
  border-radius: var(--radius);
  text-align: center;
}
.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border: 4px solid var(--brand-tint);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ---------- Bootstrap-style markup (login, reset, confirm pages) ----- */

.container-fluid { padding: 0 16px; }
.row { display: flex; flex-wrap: wrap; margin: 24px -8px 0; }
.row > [class*="col-md-"] { padding: 0 8px; flex: 0 0 100%; max-width: 100%; }
@media (min-width: 992px) {
  .col-md-1 { flex-basis: 8.333% !important; max-width: 8.333% !important; }
  .col-md-3 { flex-basis: 25% !important; max-width: 25% !important; }
  .col-md-4 { flex-basis: 33.333% !important; max-width: 33.333% !important; }
  .col-md-7 { flex-basis: 58.333% !important; max-width: 58.333% !important; }
}
/* small label/value rows inside the profile panel */
.panel-body .row { margin: 0 -8px 6px; }
.panel-body .row > [class*="col-md-"] { flex-basis: auto; max-width: none; }
.panel-body .row > .col-md-4 { flex: 0 0 110px; font-weight: 700; }
.panel-body .row > .col-md-7 { flex: 1 1 auto; }
.panel-body .row > .col-md-1 { display: none; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-heading { background: var(--brand-dark); padding: 12px 20px; }
.panel-title { color: #FFFFFF; margin: 0; font-size: 18px; }
.panel-body { padding: 20px; overflow: hidden; }

.form-group, .form-password { margin-bottom: 16px; }
.checkbox { margin-bottom: 10px; }
.checkbox input[type="checkbox"] { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; }

.alert { border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; border: 1px solid; }
.alert-success { background: var(--success-tint); border-color: var(--success); color: var(--success); }
.alert-warning { background: var(--warning-tint); border-color: var(--warning); color: var(--warning); }

.pull-right { float: right; }
.pull-left { float: left; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
@media (max-width: 767px) { .hidden-xs { display: none !important; } }
