/* Rialto Client Hub — dashboard, workspace, questionnaire and auth
   Dark charcoal canvas + orange gradient. Tokens mirror brand-kit/tokens.css;
   fallbacks are inlined so the plugin still looks right if the theme is
   swapped out. */

.rch-dash,
.rch-auth,
.rch-workspace {
  --r-bg:        var(--rialto-navy-deep, #0A0B0F);
  --r-surface:   #14171F;
  --r-surface-2: #1B1F2A;
  --r-hairline:  rgba(255, 255, 255, 0.08);
  --r-hairline-2: rgba(255, 255, 255, 0.14);
  --r-orange:      #FFB347;
  --r-orange-deep: #FF6A3D;
  --r-gradient: linear-gradient(118deg, #FFB347 0%, #FF6A3D 100%);
  --r-text:  #F4F5F7;
  --r-muted: #99A2B2;
  --r-success: #3DD68C;
  --r-error:   #FF6B6B;
  --r-radius: 16px;
}

.rch-dash { max-width: 900px; margin: 0 auto; color: var(--r-text); }
.rch-dash-head h1 { margin-bottom: 4px; }
.rch-dash-sub { color: var(--r-muted); margin-top: 0; }

.rch-panel {
  background: var(--r-surface);
  border: 1px solid var(--r-hairline);
  border-radius: var(--r-radius);
  padding: 32px;
  margin: 24px 0;
}
.rch-panel-accent {
  border-color: rgba(255, 106, 61, 0.35);
  background: linear-gradient(180deg, rgba(255, 106, 61, 0.07), transparent 42%), var(--r-surface);
}
.rch-panel-board { border-top: 2px solid var(--r-orange-deep); }
.rch-panel h2 { margin-top: 0; color: var(--r-text); }
.rch-panel p { color: var(--r-muted); }
.rch-muted { color: var(--r-muted); }

.rch-notice { border-radius: 12px; padding: 16px 20px; margin: 20px 0; }
.rch-notice-success {
  background: rgba(61, 214, 140, 0.10);
  border: 1px solid rgba(61, 214, 140, 0.35);
  color: #A9EFCB;
}
.rch-notice-warn {
  background: rgba(255, 179, 71, 0.10);
  border: 1px solid rgba(255, 179, 71, 0.35);
  color: #FFD9A0;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.rch-btn {
  display: inline-block;
  background: var(--r-gradient);
  color: #0A0B0F !important;
  border: none;
  border-radius: 999px;
  padding: 13px 28px;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  transition: filter .2s ease, transform .15s ease;
  box-shadow: 0 6px 24px rgba(255, 106, 61, 0.22);
}
.rch-btn:hover { filter: brightness(1.08); transform: translateY(-1px); color: #0A0B0F !important; }
.rch-btn-gold { background: var(--r-gradient); }
.rch-btn-ghost {
  background: transparent;
  color: var(--r-text) !important;
  box-shadow: inset 0 0 0 1px var(--r-hairline-2);
}
.rch-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--r-orange);
  color: var(--r-orange) !important;
}
.rch-btn-small { padding: 8px 18px; font-size: 13px; box-shadow: none; }

/* =========================================================
   PROGRESS TIMELINE
   ========================================================= */
.rch-timeline { list-style: none; margin: 28px 0 8px; padding: 0; display: flex; }
.rch-timeline li {
  flex: 1;
  text-align: center;
  position: relative;
  padding-top: 30px;
  color: var(--r-muted);
  font-size: 13px;
}
.rch-timeline li::before {
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--r-surface-2);
  border: 1px solid var(--r-hairline-2);
  z-index: 2;
}
.rch-timeline li::after {
  content: '';
  position: absolute;
  top: 12px; left: -50%;
  width: 100%; height: 1px;
  background: var(--r-hairline-2);
  z-index: 1;
}
.rch-timeline li:first-child::after { display: none; }
.rch-timeline li.is-done { color: var(--r-text); }
.rch-timeline li.is-done::before { background: var(--r-success); border-color: var(--r-success); }
.rch-timeline li.is-done::after { background: var(--r-success); }
.rch-timeline li.is-current { color: var(--r-text); font-weight: 600; }
.rch-timeline li.is-current::before {
  background: var(--r-orange-deep);
  border-color: var(--r-orange-deep);
  box-shadow: 0 0 0 5px rgba(255, 106, 61, 0.22);
}
.rch-timeline li.is-current::after { background: var(--r-success); }

/* =========================================================
   DOWNLOADS
   ========================================================= */
.rch-downloads { list-style: none; padding: 0; margin: 20px 0; }
.rch-download {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--r-surface-2);
  border: 1px solid var(--r-hairline);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.rch-download-ext {
  background: var(--r-gradient);
  color: #0A0B0F;
  font-size: 11px;
  font-weight: 800;
  border-radius: 6px;
  padding: 6px 9px;
  letter-spacing: 0.05em;
}
.rch-download-label { flex: 1; font-weight: 600; color: var(--r-text); }
.rch-download-note { display: block; font-weight: 400; font-size: 0.82rem; color: var(--r-muted); }

.rch-upsell {
  background: rgba(255, 106, 61, 0.06);
  border: 1px dashed rgba(255, 106, 61, 0.45);
  border-radius: 12px;
  padding: 18px 22px;
  margin-top: 24px;
}

/* =========================================================
   INSIGHTS
   ========================================================= */
.rch-insight { border-bottom: 1px solid var(--r-hairline); padding: 18px 0; }
.rch-insight:last-child { border-bottom: none; }
.rch-insight h4 { margin: 0 0 2px; }
.rch-insight-date { color: var(--r-muted); font-size: 13px; margin: 0 0 8px; }

.rch-book summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--r-orange);
  padding: 10px 0;
}

/* =========================================================
   QUESTIONNAIRE
   ========================================================= */
.rch-quiz-progress {
  height: 5px;
  background: var(--r-surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.rch-quiz-progress-bar {
  height: 100%;
  width: 0;
  background: var(--r-gradient);
  border-radius: 999px;
  transition: width .3s ease;
}
.rch-quiz-stepcount { color: var(--r-muted); font-size: 13px; margin-bottom: 20px; }
.rch-quiz-step h2 { margin-bottom: 4px; }
.rch-quiz-intro { color: var(--r-muted); margin-top: 0; margin-bottom: 24px; }

.rch-field { margin-bottom: 22px; }
.rch-field > label { display: block; font-weight: 600; color: var(--r-text); margin-bottom: 8px; }
.rch-req { color: var(--r-orange); }
.rch-field input[type="text"],
.rch-field input[type="number"],
.rch-field textarea,
.rch-field select {
  width: 100%;
  border: 1px solid var(--r-hairline-2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  background: var(--r-surface-2);
  color: var(--r-text);
  box-sizing: border-box;
  font-family: inherit;
}
.rch-field input:focus,
.rch-field textarea:focus,
.rch-field select:focus {
  outline: none;
  border-color: var(--r-orange);
  box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.18);
}
.rch-field.rch-field-invalid input,
.rch-field.rch-field-invalid textarea,
.rch-field.rch-field-invalid select,
.rch-field.rch-field-invalid .rch-checks { border-color: var(--r-error); }
.rch-field-error { color: var(--r-error); font-size: 13px; margin: 6px 0 0; }

.rch-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
}
.rch-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--r-surface-2);
  border: 1px solid var(--r-hairline);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 400 !important;
  color: var(--r-text);
}
.rch-check:hover { border-color: var(--r-orange); }
.rch-check input { margin-top: 3px; accent-color: #FF6A3D; }

.rch-quiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.rch-quiz-nav #rch-next, .rch-quiz-nav #rch-submit { margin-left: auto; }
.rch-quiz-note { color: var(--r-muted); font-size: 13px; text-align: center; margin-top: 18px; }

/* =========================================================
   ORDER BUMPS / THANK YOU
   ========================================================= */
.rch-bump {
  background: rgba(255, 106, 61, 0.06);
  border: 2px dashed rgba(255, 106, 61, 0.5);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 18px 0;
  color: var(--rialto-ink, #F4F5F7);
}
.rch-bump-label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.rch-bump-label input { margin-top: 4px; transform: scale(1.3); accent-color: #FF6A3D; }
.rch-bump-express { border-color: rgba(255, 179, 71, 0.55); }

.rch-thankyou {
  background: rgba(61, 214, 140, 0.10);
  border: 1px solid rgba(61, 214, 140, 0.35);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 24px;
}

/* =========================================================
   WORKSPACE
   ========================================================= */
.rch-alertbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(180deg, rgba(255, 106, 61, 0.12), transparent), var(--r-surface);
  border: 1px solid rgba(255, 106, 61, 0.3);
  color: var(--r-text);
  border-radius: var(--r-radius);
  padding: 16px 22px;
  margin: 20px 0 8px;
}
.rch-alertbar strong { color: var(--r-orange); }

.rch-workspace { scroll-margin-top: 90px; }
.rch-workspace .rch-panel { margin: 24px 0; }
.rch-panel-lede { color: var(--r-muted); margin-top: -4px; }
.rch-subhead { font-size: 1rem; margin: 26px 0 10px; color: var(--r-text); }
.rch-count {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--r-gradient);
  color: #0A0B0F;
  border-radius: 999px;
  padding: 4px 11px;
  vertical-align: middle;
  margin-left: 8px;
}

/* Actions */
.rch-tasks { list-style: none; padding: 0; margin: 20px 0 0; }
.rch-task {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  justify-content: space-between;
  background: var(--r-surface-2);
  border: 1px solid var(--r-hairline);
  border-left: 3px solid var(--r-orange-deep);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.rch-task.is-done { border-left-color: var(--r-success); opacity: 0.72; }
.rch-task.is-overdue { border-left-color: var(--r-error); }
.rch-task-main { flex: 1 1 320px; }
.rch-task h3 { margin: 0 0 4px; font-size: 1.03rem; color: var(--r-text); }
.rch-task.is-done h3 { text-decoration: line-through; color: var(--r-muted); }
.rch-task-desc { color: var(--r-muted); font-size: 0.94rem; }
.rch-task-desc p { margin: 4px 0; }
.rch-task-meta { font-size: 0.84rem; color: var(--r-orange); margin: 6px 0 0; font-weight: 600; }
.rch-task-overdue { color: var(--r-error); }
.rch-task-done-meta { color: var(--r-success); }
.rch-task-source { display: block; font-size: 0.78rem; color: var(--r-muted); margin-top: 6px; }
.rch-task-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.rch-task-attach { font-size: 0.76rem; color: var(--r-muted); display: flex; flex-direction: column; gap: 4px; }
.rch-task-attach input { font-size: 0.76rem; color: var(--r-muted); }

/* Messages */
.rch-thread { max-height: 460px; overflow-y: auto; padding: 4px 4px 4px 0; margin: 18px 0; }
.rch-msg { border-radius: 14px; padding: 14px 18px; margin-bottom: 12px; max-width: 85%; }
.rch-msg header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.76rem;
  margin-bottom: 6px;
}
.rch-msg-who { font-weight: 700; }
.rch-msg time { color: var(--r-muted); }
.rch-msg-body { color: var(--r-text); }
.rch-msg-body p { margin: 6px 0; }
.rch-msg-staff { background: var(--r-surface-2); border: 1px solid var(--r-hairline); }
.rch-msg-staff .rch-msg-who { color: var(--r-orange); }
.rch-msg-client {
  background: rgba(255, 106, 61, 0.09);
  border: 1px solid rgba(255, 106, 61, 0.25);
  margin-left: auto;
}
.rch-msg-client .rch-msg-who { color: var(--r-text); }

.rch-msg-form textarea,
.rch-upload-note {
  width: 100%;
  border: 1px solid var(--r-hairline-2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
  background: var(--r-surface-2);
  color: var(--r-text);
}
.rch-msg-form textarea:focus,
.rch-upload-note:focus {
  outline: none;
  border-color: var(--r-orange);
  box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.18);
}
.rch-msg-form button { margin-top: 10px; }

/* Resources */
.rch-resources { list-style: none; padding: 0; margin: 18px 0 0; }
.rch-resource {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--r-surface-2);
  border: 1px solid var(--r-hairline);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.rch-resource-main { flex: 1; }
.rch-resource h3 { margin: 0; font-size: 1rem; color: var(--r-text); }
.rch-resource-desc { margin: 4px 0 0; color: var(--r-muted); font-size: 0.9rem; }

/* Summaries */
.rch-insight-item {
  border: 1px solid var(--r-hairline);
  border-radius: 12px;
  margin-bottom: 10px;
  background: var(--r-surface-2);
}
.rch-insight-item summary {
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
}
.rch-insight-item[open] summary { border-bottom: 1px solid var(--r-hairline); }
.rch-insight-title { font-weight: 600; color: var(--r-text); }
.rch-insight-item .rch-insight-date { color: var(--r-muted); font-size: 0.8rem; margin: 0; white-space: nowrap; }
.rch-insight-body { padding: 4px 18px 16px; color: var(--r-muted); }

/* Upload */
.rch-upload-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.rch-upload-drop {
  flex: 1 1 240px;
  border: 2px dashed var(--r-hairline-2);
  border-radius: 12px;
  padding: 14px 18px;
  cursor: pointer;
  background: var(--r-surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--r-muted);
}
.rch-upload-drop:hover { border-color: var(--r-orange); }
.rch-upload-drop span { font-weight: 600; color: var(--r-text); }
.rch-upload-note { flex: 1 1 220px; width: auto; }
.rch-upload-hint { font-size: 0.8rem; color: var(--r-muted); margin-top: 10px; }

/* =========================================================
   LOGIN / SIGN-UP
   ========================================================= */
.rch-auth { max-width: 940px; margin: 0 auto; color: var(--r-text); }
.rch-auth-in { text-align: center; padding: 40px 0; }
.rch-auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 8px;
}
.rch-auth-card {
  background: var(--r-surface);
  border: 1px solid var(--r-hairline);
  border-radius: var(--r-radius);
  padding: 32px;
}
.rch-auth-card.is-primary {
  border-color: rgba(255, 106, 61, 0.35);
  background: linear-gradient(180deg, rgba(255, 106, 61, 0.07), transparent 42%), var(--r-surface);
}
.rch-auth-card h2 { margin-top: 0; color: var(--r-text); }
.rch-auth-lede { color: var(--r-muted); margin-top: -4px; }

.rch-auth-card label,
.rch-auth-form label {
  display: block;
  font-weight: 600;
  color: var(--r-text);
  margin-bottom: 6px;
  font-size: 0.94rem;
}
.rch-auth-card input[type="text"],
.rch-auth-card input[type="email"],
.rch-auth-card input[type="password"] {
  width: 100%;
  border: 1px solid var(--r-hairline-2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  box-sizing: border-box;
  background: var(--r-surface-2);
  color: var(--r-text);
}
.rch-auth-card input:focus {
  outline: none;
  border-color: var(--r-orange);
  box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.18);
}
.rch-auth-card p { margin: 0 0 16px; }
.rch-auth-card .login-remember label {
  font-weight: 400;
  color: var(--r-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.rch-auth-card .login-remember input { accent-color: #FF6A3D; }
.rch-auth-card .login-submit input[type="submit"],
.rch-auth-card .rch-btn {
  background: var(--r-gradient);
  color: #0A0B0F !important;
  border: none;
  border-radius: 999px;
  padding: 13px 26px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}
.rch-auth-card .login-submit input[type="submit"]:hover { filter: brightness(1.08); }
.rch-auth-hint { display: block; font-size: 0.78rem; color: var(--r-muted); margin-top: 5px; font-weight: 400; }
.rch-auth-alt { margin-top: 18px !important; font-size: 0.88rem; color: var(--r-muted); }
.rch-auth-alt a { color: var(--r-orange); }

/* Honeypot */
.rch-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* Nextend's Google button */
.rch-auth-card .nsl-container { margin-bottom: 18px; }

/* =========================================================
   NAV + STANDALONE ACCOUNT BUTTONS
   ========================================================= */
.main-header-menu .rch-nav-login > a,
.main-header-menu .rch-nav-dash > a {
  color: #F4F5F7 !important;
  font-weight: 600;
}
.main-header-menu .rch-nav-login > a:hover,
.main-header-menu .rch-nav-dash > a:hover { color: #FFB347 !important; }
.main-header-menu .rch-nav-signup > a {
  background: linear-gradient(118deg, #FFB347 0%, #FF6A3D 100%);
  color: #0A0B0F !important;
  border-radius: 999px;
  padding: 9px 20px !important;
  font-weight: 700;
}
.main-header-menu .rch-nav-signup > a:hover { filter: brightness(1.08); color: #0A0B0F !important; }
.main-header-menu .rch-nav-logout > a { color: #99A2B2 !important; font-size: 0.9em; }

.rch-account-buttons { display: inline-flex; align-items: center; gap: 14px; }
.rch-account-link {
  font-weight: 600;
  color: #F4F5F7 !important;
  text-decoration: none !important;
  font-size: 15px;
}
.rch-account-link:hover { color: #FFB347 !important; }
.rch-account-btn {
  background: linear-gradient(118deg, #FFB347 0%, #FF6A3D 100%);
  color: #0A0B0F !important;
  border-radius: 999px;
  padding: 9px 20px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none !important;
  transition: filter .2s ease;
}
.rch-account-btn:hover { filter: brightness(1.08); color: #0A0B0F !important; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 921px) {
  .rch-account-buttons { gap: 10px; }
  .rch-account-btn { padding: 8px 16px; font-size: 14px; }
}
@media (max-width: 640px) {
  .rch-panel { padding: 22px; }
  .rch-timeline { flex-wrap: wrap; gap: 12px 0; }
  .rch-timeline li { flex-basis: 33%; }
  .rch-timeline li::after { display: none; }
  .rch-msg { max-width: 100%; }
  .rch-task-form { align-items: flex-start; width: 100%; }
  .rch-alertbar { flex-direction: column; align-items: flex-start; }
}
