

/* ------------------------------------------------------------------
 * Every visual token lives here as a CSS variable. The Elementor
 * widget overrides these on `.ra-app`, so styling never requires
 * editing this file.
 * ---------------------------------------------------------------- */
.ra-app {
  --ra-primary: #016D39;
  --ra-primary-dark: #015a2f;
  --ra-accent: #f7a729;
  --ra-accent-dark: #f59e0b;

  --ra-text: #1e293b;
  --ra-muted: #64748b;
  --ra-line: #e2e8f0;
  --ra-soft: #f8fafc;

  --ra-card-bg: #ffffff;
  --ra-radius: 16px;
  --ra-btn-radius: 50px;
  --ra-pad: 22px;
  --ra-max-width: 580px;

  /* Gauge */
  --ra-low: #16a34a;
  --ra-mid: #facc15;
  --ra-high: #dc2626;
  --ra-track: #eef2f6;
  --ra-needle: #1e293b;
  --ra-gauge-thickness: 26;
  --ra-gauge-size: 340px;

  font-family: 'iransans', sans-serif;
  direction: rtl;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px;
  box-sizing: border-box;
}

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

.ra-card {
  background: var(--ra-card-bg);
  border-radius: var(--ra-radius);
  box-shadow: 0 4px 24px rgba(1, 109, 57, 0.07);
  width: 100%;
  max-width: var(--ra-max-width);
  overflow: hidden;
  border: 1px solid var(--ra-line);
}

.ra-card-inner {
  padding: var(--ra-pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ra-step { display: none; }
.ra-step.active { display: block; }

/* ---------------- Landing ---------------- */
.ra-company {
  text-align: center;
  font-size: 11px;
  color: var(--ra-muted);
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.ra-title {
  font-size: 22px;
  color: var(--ra-primary);
  text-align: center;
  margin: 0 0 6px;
  font-weight: 800;
  line-height: 1.5;
}

.ra-subtitle {
  font-size: 13px;
  color: var(--ra-muted);
  text-align: center;
  margin: 0 0 18px;
  line-height: 1.9;
}

.ra-form-type {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 16px;
}

.ra-form-type label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ra-text);
  font-weight: 600;
}

.ra-form-type input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--ra-primary);
}

.ra-user-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.ra-field { display: flex; flex-direction: column; gap: 6px; }

.ra-field label {
  font-size: 12px;
  color: #475569;
  font-weight: 600;
  line-height: 1.6;
}

.ra-field input,
.ra-field select,
.ra-field textarea,
.ra-comments-box {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--ra-line);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--ra-soft);
  color: var(--ra-text);
  line-height: 1.8;
}

.ra-field input:focus,
.ra-field select:focus,
.ra-field textarea:focus,
.ra-comments-box:focus {
  border-color: var(--ra-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(1, 109, 57, 0.1);
  background: #fff;
}

/* ---------------- Buttons ---------------- */
.ra-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border: none;
  border-radius: var(--ra-btn-radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  line-height: 1.4;
}

.ra-btn:disabled { opacity: 0.7; cursor: default; transform: none; }

.ra-btn-primary {
  background: linear-gradient(135deg, var(--ra-primary) 0%, var(--ra-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(1, 109, 57, 0.22);
}

.ra-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(1, 109, 57, 0.3);
}

.ra-btn-secondary { background: #f1f5f9; color: #475569; }
.ra-btn-secondary:hover { background: var(--ra-line); }

.ra-btn-consult {
  background: linear-gradient(135deg, var(--ra-accent) 0%, var(--ra-accent-dark) 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(247, 167, 41, 0.25);
}

.ra-btn-consult:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(247, 167, 41, 0.35);
}

.ra-btn-done { background: var(--ra-primary) !important; }

.ra-start { width: 100%; margin-top: 2px; }

.ra-error-msg {
  color: #ef4444;
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
  min-height: 16px;
  line-height: 1.7;
}

/* ---------------- Questions ---------------- */
.ra-progress {
  width: 100%;
  height: 5px;
  background: var(--ra-line);
  border-radius: 3px;
  margin-bottom: 18px;
  overflow: hidden;
}

.ra-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ra-primary), var(--ra-accent));
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

.ra-q-num {
  font-size: 12px;
  color: var(--ra-primary);
  font-weight: 700;
  margin-bottom: 8px;
}

.ra-q-text {
  font-size: 15px;
  color: var(--ra-text);
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.9;
}

.ra-opt-tag {
  font-size: 10px;
  color: var(--ra-muted);
  font-weight: 500;
  background: #f1f5f9;
  padding: 3px 9px;
  border-radius: 20px;
  margin-right: 6px;
  white-space: nowrap;
}

.ra-answer {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  margin-bottom: 8px;
  border: 1.5px solid var(--ra-line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  color: #475569;
  line-height: 1.8;
}

.ra-answer:hover { border-color: var(--ra-primary); background: rgba(1, 109, 57, 0.04); }

.ra-answer.selected {
  border-color: var(--ra-primary);
  background: rgba(1, 109, 57, 0.07);
  color: var(--ra-primary);
  font-weight: 600;
}

.ra-answer input[type="radio"] {
  margin: 0 0 0 10px;
  width: 17px;
  height: 17px;
  accent-color: var(--ra-primary);
  flex-shrink: 0;
}

.ra-answer label { cursor: pointer; flex: 1; }

.ra-q-error {
  color: #ef4444;
  font-size: 12px;
  margin-top: 6px;
  min-height: 16px;
}

.ra-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  gap: 10px;
}

/* ---------------- Comments ---------------- */
.ra-comments-title {
  font-size: 17px;
  color: var(--ra-primary);
  margin: 0 0 6px;
  font-weight: 700;
}

.ra-comments-desc {
  font-size: 12px;
  color: var(--ra-muted);
  margin: 0 0 14px;
  line-height: 1.9;
}

.ra-comments-box {
  width: 100%;
  resize: vertical;
  margin-bottom: 4px;
}

/* ---------------- Result ---------------- */
.ra-result-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--ra-primary);
  margin: 0 0 4px;
  text-align: center;
  line-height: 1.6;
}

.ra-gauge-wrap {
  display: flex;
  justify-content: center;
  margin: 6px 0 4px;
}

.ra-gauge-svg {
  width: 100%;
  max-width: var(--ra-gauge-size);
  height: auto;
  display: block;
  overflow: visible;
}

.ra-needle {
  transform: rotate(-90deg);
  transition: transform 1.3s cubic-bezier(0.34, 1.35, 0.64, 1);
}

@media (prefers-reduced-motion: reduce) {
  .ra-needle { transition: none; }
}

.ra-result-level {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  margin: 2px 0 6px;
  line-height: 1.6;
}

.ra-result-level.low { color: var(--ra-low); }
.ra-result-level.mid { color: var(--ra-mid); }
.ra-result-level.high { color: var(--ra-high); }

/* Pill variant (Elementor: «نمایش سطح ریسک به شکل برچسب») */
.ra-pill-yes .ra-result-level {
  display: block;
  width: fit-content;
  margin: 6px auto 10px;
  padding: 10px 34px;
  border-radius: 12px;
  color: #fff;
  font-size: 17px;
}

.ra-pill-yes .ra-result-level.low { background: var(--ra-low); }
.ra-pill-yes .ra-result-level.mid { background: var(--ra-mid); color: #4a3a00; }
.ra-pill-yes .ra-result-level.high { background: var(--ra-high); }

.ra-result-score {
  text-align: center;
  font-size: 12px;
  color: var(--ra-muted);
  margin-bottom: 12px;
}

.ra-result-desc {
  text-align: center;
  font-size: 13px;
  color: #475569;
  line-height: 2;
  margin-bottom: 16px;
  padding: 0 4px;
}

.ra-portfolio {
  background: var(--ra-soft);
  border: 1px solid var(--ra-line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.ra-portfolio h3 {
  font-size: 14px;
  color: var(--ra-primary);
  margin: 0 0 10px;
  text-align: center;
  font-weight: 700;
}

.ra-portfolio table { width: 100%; border-collapse: collapse; }

.ra-portfolio th {
  text-align: right;
  padding: 9px 8px;
  font-size: 12px;
  color: var(--ra-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--ra-line);
}

.ra-portfolio td {
  text-align: left;
  padding: 9px 8px;
  font-size: 13px;
  color: var(--ra-text);
  font-weight: 700;
  border-bottom: 1px solid var(--ra-line);
  white-space: nowrap;
}

.ra-portfolio tr:last-child th,
.ra-portfolio tr:last-child td { border-bottom: none; }

.ra-portfolio-pattern {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ra-primary);
}

.ra-consult-text {
  background: rgba(1, 109, 57, 0.04);
  border: 1px solid var(--ra-line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: #475569;
  line-height: 2.1;
  text-align: justify;
}

.ra-consult-text p { margin: 0; }
.ra-consult-text p + p { margin-top: 8px; }
.ra-consult-text:empty { display: none; }

.ra-result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------------- Consultation ---------------- */
.ra-consult-title {
  font-size: 17px;
  color: var(--ra-primary);
  margin: 0 0 14px;
  text-align: center;
  font-weight: 700;
}

.ra-user-summary {
  background: rgba(1, 109, 57, 0.05);
  border: 1px solid var(--ra-line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 12.5px;
  color: #475569;
  line-height: 2;
}

.ra-user-summary strong { color: var(--ra-primary); }

/* Consistent breathing room between the consultation fields */
.ra-consult-form {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.ra-form-msg {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-bottom: 12px;
  line-height: 1.9;
  display: none;
}

.ra-form-msg.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  display: block;
}

.ra-form-msg.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  display: block;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 600px) {
  .ra-app { --ra-pad: 16px; padding: 8px; }
  .ra-title { font-size: 18px; }
  .ra-result-title { font-size: 17px; }
  .ra-user-info { grid-template-columns: 1fr; }
  .ra-q-text { font-size: 14px; }
  .ra-nav { flex-direction: column-reverse; }
  .ra-nav .ra-btn { width: 100%; }
  .ra-result-actions { flex-direction: column; }
  .ra-result-actions .ra-btn { width: 100%; }
  .ra-portfolio td { white-space: normal; }
}
