/* ============================================================
   سامانه محاسبات انرژی و نامبرولوژی — Style System
   Modern Luxury Feng Shui — Black / Emerald / Gold / Glass
   ============================================================ */

:root {
  --c-black: #090909;
  --c-black-2: #0e1210;
  --c-emerald: #0B5D52;
  --c-emerald-light: #12897a;
  --c-gold: #D4AF37;
  --c-gold-soft: #e8cf7a;
  --c-text: #EDEDE7;
  --c-text-dim: #a9b3af;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(212, 175, 55, 0.35);
  --shadow-gold: 0 0 24px rgba(212, 175, 55, 0.25);
  --shadow-emerald: 0 0 30px rgba(11, 93, 82, 0.45);
  --radius-lg: 24px;
  --radius-md: 16px;
  --font-display: 'Vazirmatn', Tahoma, sans-serif;
  --font-body: 'Vazirmatn', Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 20% 0%, #0d2622 0%, var(--c-black) 45%),
              radial-gradient(ellipse at 80% 100%, #14231f 0%, var(--c-black) 55%),
              var(--c-black);
  color: var(--c-text);
  font-family: var(--font-body);
  overflow-x: hidden;
  position: relative;
}

/* ---------- Animated ambient background ---------- */
#bg-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
  animation: floatGlow 18s ease-in-out infinite;
}
.bg-glow.g1 { width: 480px; height: 480px; background: var(--c-emerald); top: -120px; right: -120px; }
.bg-glow.g2 { width: 380px; height: 380px; background: var(--c-gold); bottom: -100px; left: -100px; animation-delay: 4s; }
.bg-glow.g3 { width: 320px; height: 320px; background: var(--c-emerald-light); top: 40%; left: 45%; animation-delay: 9s; opacity: .2; }

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.08); }
}

/* ---------- Layout shell ---------- */
.app-shell { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 32px 20px 90px; }

.brand-header { text-align: center; margin-bottom: 42px; }
.brand-header .logo-ring {
  width: 78px; height: 78px; margin: 0 auto 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(from 0deg, var(--c-gold), var(--c-emerald), var(--c-gold));
  box-shadow: var(--shadow-gold);
  animation: spinSlow 12s linear infinite;
}
.brand-header .logo-ring i {
  background: var(--c-black); width: 62px; height: 62px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--c-gold); font-size: 26px;
}
@keyframes spinSlow { to { transform: rotate(360deg); } }

.brand-header h1 {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(24px, 4vw, 38px);
  background: linear-gradient(90deg, var(--c-gold-soft), var(--c-gold), var(--c-emerald-light));
  -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0 0 8px;
}
.brand-header p { color: var(--c-text-dim); font-size: 15px; margin: 0; }

/* ---------- Glass card ---------- */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}
.glass-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(212,175,55,0.08), transparent 40%);
  pointer-events: none;
}
.glass-card:hover {
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 12px 40px rgba(0,0,0,.55), var(--shadow-gold);
}

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

.field { position: relative; }
.field label { display: block; font-size: 13px; color: var(--c-gold-soft); margin-bottom: 8px; font-weight: 600; }
.field .input-wrap { position: relative; }
.field i.field-icon {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--c-emerald-light); pointer-events: none; font-size: 15px;
}
.field input, .field select {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212,175,55,0.25);
  color: var(--c-text);
  border-radius: 14px;
  padding: 14px 46px 14px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.field input::placeholder { color: #6b756f; }
.field input:focus, .field select:focus {
  border-color: var(--c-gold);
  background: rgba(212,175,55,0.05);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.12);
}
.field input.is-invalid { border-color: #e05a5a; }
.field .error-msg { color: #f08787; font-size: 12px; margin-top: 6px; display: none; }
.field .error-msg.show { display: block; }

.gender-toggle { display: flex; gap: 10px; }
.gender-toggle button {
  flex: 1; padding: 13px; border-radius: 14px;
  border: 1px solid rgba(212,175,55,0.25);
  background: rgba(255,255,255,0.03);
  color: var(--c-text-dim); cursor: pointer;
  font-family: var(--font-body); font-size: 14px;
  transition: all .25s ease;
}
.gender-toggle button.active {
  background: linear-gradient(135deg, var(--c-emerald), var(--c-emerald-light));
  color: #fff; border-color: var(--c-emerald-light); box-shadow: var(--shadow-emerald);
}

/* ---------- Buttons ---------- */
.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 17px 28px; border-radius: 16px; border: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 16px; color: #100c02;
  background: linear-gradient(120deg, var(--c-gold-soft), var(--c-gold) 45%, #b6892a);
  background-size: 200% auto;
  box-shadow: var(--shadow-gold);
  transition: background-position .5s ease, transform .2s ease, box-shadow .3s ease;
}
.btn-gold:hover { background-position: right center; transform: translateY(-2px); box-shadow: 0 6px 30px rgba(212,175,55,0.4); }
.btn-gold:active { transform: translateY(0); }
.btn-gold:disabled { opacity: .6; cursor: not-allowed; transform:none; }

.btn-ghost {
  display: inline-flex; align-items:center; gap:8px;
  padding: 12px 20px; border-radius: 14px;
  border: 1px solid rgba(212,175,55,0.35);
  background: transparent; color: var(--c-gold-soft); cursor: pointer;
  font-family: var(--font-body); font-size: 14px;
  transition: all .25s ease;
}
.btn-ghost:hover { background: rgba(212,175,55,0.08); }

/* ---------- Report ---------- */
.report-section { display: none; }
.report-section.active { display: block; }

.summary-card { text-align: center; padding: 44px 28px; }
.summary-card .score-ring { width: 150px; height: 150px; margin: 0 auto 20px; position: relative; }
.summary-card .score-ring svg { transform: rotate(-90deg); }
.summary-card .score-ring .score-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; font-family: var(--font-display);
}
.summary-card .score-ring .score-num b { font-size: 34px; color: var(--c-gold); }
.summary-card .score-ring .score-num span { font-size: 11px; color: var(--c-text-dim); }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin-top: 24px; }

.info-card { padding: 24px; }
.info-card .icon-badge {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--c-emerald), var(--c-black-2));
  color: var(--c-gold); font-size: 20px; margin-bottom: 16px;
  border: 1px solid rgba(212,175,55,0.3);
}
.info-card h3 { font-family: var(--font-display); font-size: 17px; margin: 0 0 8px; color: var(--c-gold-soft); }
.info-card .big-value { font-size: 30px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.info-card p { color: var(--c-text-dim); font-size: 13.5px; line-height: 1.9; margin: 0; }
.info-card .badge-master {
  display:inline-block; margin-top:8px; padding:3px 10px; border-radius:20px;
  font-size:11px; background:rgba(212,175,55,0.15); color:var(--c-gold); border:1px solid rgba(212,175,55,0.4);
}

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag-list span {
  padding: 6px 14px; border-radius: 20px; font-size: 12.5px;
  background: rgba(11,93,82,0.25); border: 1px solid rgba(18,137,122,0.5); color: #a9e8dd;
}

.direction-grid { display:grid; grid-template-columns: repeat(2,1fr); gap:10px; margin-top:12px; }
.direction-chip {
  padding:10px 12px; border-radius:12px; font-size:12.5px;
  background: rgba(255,255,255,0.03); border:1px solid rgba(212,175,55,0.2);
  display:flex; justify-content:space-between; align-items:center;
}
.direction-chip.bad { border-color: rgba(224,90,90,0.35); }
.direction-chip b { color: var(--c-gold-soft); }
.direction-chip.bad b { color:#f08787; }

.section-title {
  font-family: var(--font-display); font-size: 20px; color: var(--c-gold-soft);
  margin: 44px 0 18px; display: flex; align-items: center; gap: 10px;
}
.section-title i { color: var(--c-emerald-light); }

.advice-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.advice-list li {
  padding: 14px 18px; border-radius: 14px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(212,175,55,0.2);
  font-size: 13.5px; line-height: 1.8; color: var(--c-text);
  display: flex; gap: 10px;
}
.advice-list li i { color: var(--c-gold); margin-top: 3px; }

.chart-card { padding: 24px; }
.chart-wrap { position: relative; height: 320px; }

/* ---------- Floating symbols ---------- */
.floating-symbol {
  position: fixed; color: rgba(212,175,55,0.12); font-size: 42px;
  z-index: 0; pointer-events: none; animation: floatUpDown 10s ease-in-out infinite;
}
@keyframes floatUpDown {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(8deg); }
}

/* ---------- Loading overlay ---------- */
.loading-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(9,9,9,0.88);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.loading-overlay.show { opacity: 1; pointer-events: all; }
.loader-ring {
  width: 64px; height: 64px; border-radius: 50%;
  border: 3px solid rgba(212,175,55,0.2);
  border-top-color: var(--c-gold);
  animation: spinSlow 1s linear infinite;
}
.loading-overlay p { color: var(--c-gold-soft); font-family: var(--font-display); }

/* ---------- Footer / actions ---------- */
.action-bar { display:flex; gap:14px; justify-content:center; margin-top: 34px; flex-wrap: wrap; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--c-black); }
::-webkit-scrollbar-thumb { background: var(--c-emerald); border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
