/* ==== فرم اصلی ==== */
.frp-fall-risk-form {
  width: 100%;
  margin: 0 auto;
  padding: 30px 20px;
  background: #fff;
  border-radius: 12px;
  border-top: 5px solid #0073aa;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  font-family: inherit;
  box-sizing: border-box;
}

/* هدر فرم */
.frp-fall-risk-header {
  background: linear-gradient(135deg, #0000fb, #005c94);
  color: #fff;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
  animation: frp-pulse 2s infinite;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.frp-fall-risk-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
  color: #fff;
}
.frp-fall-risk-header::before {
  content: '';
  position: absolute;
  top: 0; left: -50%;
  width: 200%; height: 100%;
  background: rgba(255,255,255,0.15);
  transform: skewX(-45deg);
  animation: frp-shine 3s infinite;
}
@keyframes frp-shine {
  from { left: -50%; }
  to { left: 150%; }
}
@keyframes frp-pulse {
  0%,100% { text-shadow: 0 0 10px #0073aa, 0 0 20px #0073aa; }
  50% { text-shadow: 0 0 20px #00bcd4, 0 0 30px #00bcd4; }
}

/* جعبه هر فیلد */
.frp-field-box {
  background: #fdfdfd;
  padding: 18px 20px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: box-shadow 0.3s;
}
.frp-field-box:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.frp-field-box label {
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
  color: #222;
}
.frp-field-box .frp-help {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-left: 3px solid #0073aa;
  background: #f1f9ff;
  border-radius: 6px;
}

/* گروه فیلدها (دو ستونه) */
.frp-field-group {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}
.frp-field-box.half { flex: 1 1 calc(50% - 10px); }
.frp-field-box.full { flex: 1 1 100%; }

/* اینپوت و سلکت */
.frp-fall-risk-form input,
.frp-fall-risk-form select {
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  width: 100%;
  background: #fff;
  color: #333;
  box-sizing: border-box;
  transition: border-color 0.3s;
}
.frp-fall-risk-form input:focus,
.frp-fall-risk-form select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 8px rgba(0,123,255,0.3);
}

/* دکمه‌ها */
.frp-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 25px;
}
.frp-fall-risk-form button {
  flex: 1 1 200px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(135deg,#007bff,#0056b3);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 5px 10px rgba(0,0,0,0.2);
  transition: all 0.3s;
}
.frp-fall-risk-form button:hover {
  background: linear-gradient(135deg,#0056b3,#003d7a);
  transform: translateY(-2px);
}
.frp-fall-risk-form button:active { transform: translateY(2px); }
.frp-reset-btn {
  background: linear-gradient(135deg,#fc7e7e,#fb3737) !important;
}
.frp-reset-btn:hover {
  background: linear-gradient(135deg,#fb3737,#b92525) !important;
}

/* توضیح زیر فیلدها */
.frp-help {
  display: block;
  margin-top: 6px;
  padding: 10px 12px;
  background: #f1f9ff;
  border-left: 4px solid #0073aa;
  border-radius: 6px;
  font-size: 0.88rem;
  color: #444;
  line-height: 1.6;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
  transition: background 0.3s;
}
.frp-help:hover { background: #e8f4ff; }

/* کادر اعتبار پایین فرم */
.frp-credit-box {
  margin-top: 40px;
  padding: 15px 20px;
  background: #f4f9ff;
  border: 1px solid #d0e6fb;
  border-radius: 8px;
  text-align: center;
  font-size: 0.9rem;
  color: #555;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}
.frp-credit-box strong {
  color: #0073aa;
  font-weight: 600;
}

/* ==== جعبه نمایش نتایج ==== */
.frp-fall-risk-result {
  max-width: 1000px;
  margin: 40px auto;
  padding: 30px 30px 40px;
  border-radius: 14px;
  background: #fff;
  color: #222;
  border: 1px solid #e4e4e4;
  box-shadow: 0 8px 30px rgba(0,0,0,0.05);
  font-size: 1rem;
  line-height: 1.8;
  position: relative;
  overflow: hidden;
}
.frp-fall-risk-result.level-low    { border-top: 6px solid #28a745; }
.frp-fall-risk-result.level-moderate { border-top: 6px solid #ffc107; }
.frp-fall-risk-result.level-high   { border-top: 6px solid #dc3545; }

/* نوار پیشرفت ریسک */
.frp-risk-bar {
  background: #eee;
  height: 10px;
  border-radius: 8px;
  margin: 20px 0;
  overflow: hidden;
}
.frp-risk-fill {
  height: 100%;
  background: #0073aa;
  transition: width 0.6s;
  border-radius: 8px;
}

/* امتیاز و BMI */
.frp-risk-score {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 10px;
}
.frp-risk-bmi {
  font-size: 0.95rem;
  margin-bottom: 20px;
  color: #555;
}
.bmi-alert  { color: #c82333; font-weight: bold; }
.bmi-normal { color: #218838; font-weight: bold; }

/* خلاصه اطلاعات کاربر */
.frp-risk-summary {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  border: 1px dashed #ccc;
  margin: 30px 0 20px;
}
.frp-risk-summary h4 {
  margin-bottom: 12px;
  color: #0073aa;
  font-weight: bold;
}
.frp-risk-summary ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.frp-risk-summary li {
  padding: 5px 0;
  border-bottom: 1px dashed #ddd;
  font-size: 0.95rem;
}
.frp-risk-summary li:last-child { border-bottom: none; }

/* ==== تحلیل نهایی ==== */
.frp-analysis-final {
  background: linear-gradient(135deg,#eaf6ff 70%,#f1fff8 100%);
  border: 2.5px solid #00bcd4;
  box-shadow: 0 4px 20px rgba(0,188,212,0.07), 0 1.5px 10px rgba(0,188,212,0.04) inset;
  margin-bottom: 28px;
  padding: 32px 24px 28px 24px;
  border-radius: 16px;
  position: relative;
  transition: box-shadow 0.3s;
}
.frp-analysis-final h4 {
  font-size: 1.2rem;
  color: #14b8a6;
  font-weight: bold;
  margin-top: 0;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: 0.8px;
}
.frp-analysis-final h4::before {
  content: "🧠";
  font-size: 2.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg,#fffbe6 80%,#e0f7fa 100%);
  border: 2.5px solid #f6c344;
  width: 46px;
  height: 46px;
  box-shadow: 0 2px 12px #f9d47557;
}
.frp-analysis-final p {
  font-size: 1.08rem;
  color: #01568b;
  font-weight: 500;
  margin: 0 0 12px 0;
  line-height: 2.1;
  letter-spacing: 0.2px;
}
/* پیام‌های ویژه */
.frp-analysis-final .danger { color: #d7263d !important; font-weight: bold; }
.frp-analysis-final .success { color: #218838 !important; font-weight: bold; }
.frp-analysis-final .warning { color: #e6b800 !important; font-weight: bold; }

/* ==== تحلیل اختصاصی ==== */
.frp-analysis-detail {
  background: linear-gradient(135deg,#f3f7fa 85%,#eefcf6 100%);
  border: 2px dashed #1fb6ff;
  border-radius: 16px;
  padding: 28px 20px 24px 20px;
  margin-bottom: 30px;
  box-shadow: 0 1.5px 12px #7ad8e817;
}
.frp-analysis-detail h4 {
  font-size: 1.11rem;
  color: #0891b2;
  font-weight: bold;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: 0.6px;
}
.frp-analysis-detail h4::before {
  content: "🧠";
  font-size: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg,#f8fafc 70%,#e0f2fe 100%);
  border: 2px solid #0ea5e9;
  width: 36px;
  height: 36px;
  box-shadow: 0 2px 10px #7ad8e838;
}
.frp-analysis-detail p {
  font-size: 1.04rem;
  color: #16658a;
  margin-bottom: 10px;
  line-height: 2.1;
}
.frp-analysis-points {
  list-style: none;
  padding: 0;
  margin: 12px 0 22px 0;
  font-size: 0.99rem;
}
.frp-analysis-points li {
  padding: 7px 0 7px 6px;
  border-bottom: 1px dashed #b2e6ff;
  display: flex;
  align-items: center;
  gap: 7px;
}
.frp-analysis-points li:last-child { border-bottom: none; }
.frp-analysis-points strong { color: #0293b8; font-weight: bold; font-size: 1.01em; }

/* ==== جدول مقایسه ==== */
.frp-risk-compare {
  margin: 18px 0 0 0;
}
.frp-risk-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1.5px 10px #00bcd424;
  direction: ltr;
}
.frp-risk-table thead tr {
  background: linear-gradient(90deg, #0ea5e9 65%, #34d399 100%);
}
.frp-risk-table th, .frp-risk-table td {
  padding: 11px 14px;
  font-size: 0.99rem;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
  color: #333;
  white-space: nowrap;
}
.frp-risk-table th {
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.4px;
  border-bottom: 2px solid #0ea5e9;
}
.frp-risk-table tbody tr:last-child td { border-bottom: none; }
.frp-risk-table td:first-child,
.frp-risk-table th:first-child { font-family: inherit; direction: ltr; }
.frp-risk-table td { background: #f9fdff; }
.frp-risk-table tr:nth-child(even) td { background: #f4fbff; }
.frp-risk-table tr:hover td { background: #e0f7fa; color: #069; }
.frp-risk-table td span.tug-en { font-family: inherit; font-weight: bold; color: #0077b6; letter-spacing: 0.2px; }

/* ریسپانسیو جدول */
@media (max-width: 600px) {
  .frp-risk-table th, .frp-risk-table td { padding: 8px 3px; font-size: 0.95rem; }
}

/* لیست پیشنهادها */
.frp-suggestions {
  background: #fafafa;
  border: 1px solid #eaeaea;
  border-radius: 10px;
  padding: 20px;
}
.frp-suggestions h4 {
  font-size: 1rem;
  margin-bottom: 14px;
  color: #444;
}
.frp-suggestions ol {
  margin: 0;
  padding-left: 20px;
  font-size: 0.92rem;
  color: #333;
}
.frp-suggestions li { margin-bottom: 8px; }

/* افکت خاص برای شاهکار: درخشش مرزی نوار ریسک */
.frp-fall-risk-result::after {
  content: '';
  position: absolute;
  top: 0; left: -50%;
  width: 200%; height: 6px;
  background: linear-gradient(90deg,#0073aa,#00c3ff,#0073aa);
  animation: frp-shine-bar 6s linear infinite;
  z-index: 1;
  opacity: 0.15;
}
@keyframes frp-shine-bar {
  0% { left: -50%; }
  100% { left: 150%; }
}

/* دکمه اشتراک‌گذاری */
.frp-share-btn {
  margin-top: 25px;
  padding: 12px 24px;
  font-size: 0.95rem;
  background: linear-gradient(135deg,#28d88a,#2dc6ff);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
}
.frp-share-btn:hover {
  background: linear-gradient(135deg,#1bb468,#2e9cf7);
  transform: scale(1.02);
}

/* ==== ریسپانسیو ==== */
@media (max-width: 768px) {
  .frp-fall-risk-result { padding: 20px; }
  .frp-buttons { flex-direction: column; }
  .frp-fall-risk-form {
    padding: 20px 15px;
    margin: 20px auto;
    max-width: 100%;
    box-sizing: border-box;
  }
  .frp-fall-risk-form button { width: 100%; flex: none; }
  .frp-field-box.half { flex: 1 1 100%; }
}

/* ==== استایل ویژه برای پرینت ==== */
@media print {
  * {
    background: #fff !important;
    color: #222 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    font-family: inherit !important;
  }
  .frp-fall-risk-header,
  .frp-field-box,
  .frp-risk-analysis,
  .frp-risk-summary,
  .frp-suggestions,
  .frp-fall-risk-result {
    background: #fff !important;
    color: #222 !important;
    border-color: #888 !important;
  }
  .frp-fall-risk-header::before,
  .frp-fall-risk-result::after {
    display: none !important;
  }
  .frp-share-btn, .frp-credit-box { display: none !important; }
}
