/* styles.css — سیستم طراحی v3.1 «Cardio Aurora»
   دو تم کامل: لایتِ گرم با مشِ رنگیِ لطیف + دارکِ عمیقِ نیمه‌شب با درخشش‌های نئونی.
   تم با data-theme="dark" روی <html> فعال می‌شود و همه‌چیز از متغیرها رنگ می‌گیرد. */

/* فونت فارسی وزیرمتن — خودمیزبان (متغیر، وزن ۱۰۰ تا ۹۰۰) */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/shared/fonts/Vazirmatn.woff2') format('woff2-variations'),
       url('/shared/fonts/Vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy-900: #0b1533;
  --navy-800: #101d40;
  --navy-700: #1a2b5c;
  --red-500: #e63950;
  --red-600: #c92840;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --mint-500: #10b981;
  --mint-600: #059669;
  --amber-500: #f59e0b;

  /* ---- تمِ روشن ---- */
  --page-bg: #eef0fb;
  --ink: #191c33;
  --muted: #767c9e;
  --line: #e3e6f5;
  --line-strong: #d3d8ee;
  --card-bg: #ffffff;
  --card-glass: rgba(255, 255, 255, 0.72);
  --input-bg: #fafbff;
  --chip-bg: #ffffff;
  --chip-ink: #333a5e;
  --sub-chip-bg: #f1f3fb;
  --soft-blue-bg: #e9f0fe;
  --tab-rail: #e1e5f3;
  --tab-ink: #5a6080;
  --hero-grad: linear-gradient(135deg, #0e1a3e 0%, #1a2b5c 55%, #c92840 135%);
  --shadow-sm: 0 1px 3px rgba(15, 23, 52, 0.06), 0 4px 14px rgba(15, 23, 52, 0.05);
  --shadow-md: 0 8px 26px rgba(15, 23, 52, 0.11);
  --shadow-lg: 0 18px 48px rgba(15, 23, 52, 0.16);
  --glow-blue: 0 6px 18px rgba(37, 99, 235, 0.28);
  --glow-red: 0 6px 18px rgba(230, 57, 80, 0.30);
  --glow-mint: 0 6px 18px rgba(16, 185, 129, 0.30);
  --mesh:
    radial-gradient(46rem 30rem at 112% -8%, rgba(230, 57, 80, 0.10), transparent 62%),
    radial-gradient(40rem 28rem at -12% -4%, rgba(59, 130, 246, 0.12), transparent 58%),
    radial-gradient(34rem 26rem at 50% 118%, rgba(16, 185, 129, 0.09), transparent 60%),
    radial-gradient(26rem 20rem at 88% 62%, rgba(139, 92, 246, 0.07), transparent 55%);
  --font: 'Vazirmatn', 'IRANSans', 'B Nazanin', 'Segoe UI', 'Noto Sans Arabic', Tahoma, sans-serif;

  /* سازگاری با نام‌های قدیمی */
  --deep-navy: var(--navy-900);
  --cardio-red: var(--red-500);
  --cardio-red-dark: var(--red-600);
  --accent-blue: var(--blue-600);
  --mint: var(--mint-500);
}

/* ---- تمِ تیره ---- */
[data-theme="dark"] {
  --page-bg: #0c1122;
  --ink: #e9ecff;
  --muted: #8d94bd;
  --line: #232a4e;
  --line-strong: #303a68;
  --card-bg: #141a36;
  --card-glass: rgba(20, 26, 54, 0.78);
  --input-bg: #0f1530;
  --chip-bg: #171e40;
  --chip-ink: #c6cbf0;
  --sub-chip-bg: #10173382;
  --soft-blue-bg: #14204a;
  --tab-rail: #10173a;
  --tab-ink: #7f87b3;
  --hero-grad: linear-gradient(135deg, #0a1230 0%, #14224e 55%, #8f1d33 140%);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 54px rgba(0, 0, 0, 0.55);
  --glow-blue: 0 6px 22px rgba(59, 130, 246, 0.38);
  --glow-red: 0 6px 22px rgba(230, 57, 80, 0.40);
  --glow-mint: 0 6px 22px rgba(16, 185, 129, 0.38);
  --mesh:
    radial-gradient(48rem 32rem at 112% -8%, rgba(230, 57, 80, 0.13), transparent 60%),
    radial-gradient(42rem 30rem at -12% -4%, rgba(59, 130, 246, 0.15), transparent 56%),
    radial-gradient(36rem 26rem at 50% 120%, rgba(16, 185, 129, 0.10), transparent 58%),
    radial-gradient(28rem 22rem at 88% 60%, rgba(139, 92, 246, 0.12), transparent 55%);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

body {
  font-family: var(--font);
  background: var(--mesh), var(--page-bg);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color .35s ease, color .35s ease;
}
a { color: var(--blue-500); text-decoration: none; }
button {
  font-family: inherit; cursor: pointer; border: none; border-radius: 12px;
  transition: transform .12s ease, box-shadow .22s ease, background .22s ease, opacity .2s ease, filter .2s ease;
}
button:active { transform: scale(0.965); }
input, textarea, select { font-family: inherit; transition: border-color .18s ease, box-shadow .18s ease, background .3s ease; }

/* ---------- سربرگ ---------- */
.hero {
  background: var(--hero-grad);
  color: #fff;
  padding: 18px 18px 14px;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 26px 26px;
  box-shadow: var(--shadow-md);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(30rem 12rem at 82% -45%, rgba(255, 255, 255, 0.16), transparent 70%),
    radial-gradient(18rem 10rem at 10% 130%, rgba(230, 57, 80, 0.25), transparent 70%);
  pointer-events: none;
}
.hero h1 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -0.2px; position: relative; }
.hero .heart { display: inline-block; animation: heartbeat 1.15s infinite; font-size: 21px; filter: drop-shadow(0 2px 8px rgba(230, 57, 80, .6)); }
@keyframes heartbeat { 0%,100% { transform: scale(1);} 25% { transform: scale(1.28);} 40% { transform: scale(1);} 60% { transform: scale(1.14);} }
.ecg-line { width: 100%; height: 28px; margin-top: 8px; opacity: .92; position: relative; }
.ecg-path { fill: none; stroke: #ffffffd6; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 2.6s linear infinite; }
@keyframes draw { to { stroke-dashoffset: -400; } }

.hero-actions { position: absolute; top: 13px; inset-inline-end: 14px; display: flex; gap: 6px; z-index: 2; align-items: center; }
.lang-switch { display: flex; gap: 5px; }
.lang-switch button {
  background: rgba(255,255,255,0.14); color: #fff; font-size: 11.5px; padding: 5px 11px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,0.18); font-weight: 600;
}
.lang-switch button.active { background: #fff; color: var(--navy-900); font-weight: 800; }
.theme-toggle {
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.18);
  color: #fff; width: 30px; height: 26px; border-radius: 999px; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}

/* ---------- چیدمان ---------- */
.container { max-width: 520px; margin: 0 auto; padding: 16px 16px 34px; }
.card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  margin-bottom: 14px;
  transition: background .3s ease, border-color .3s ease;
}
.card h3 { letter-spacing: -0.2px; color: var(--ink); }

/* ---------- فرم‌ها ---------- */
label { display: block; font-size: 13px; margin: 12px 0 6px; font-weight: 700; color: var(--ink); opacity: .84; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=search], textarea, select {
  width: 100%; padding: 13px 14px; font-size: 15px;
  border: 1.6px solid var(--line-strong); border-radius: 12px;
  background: var(--input-bg); color: var(--ink);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
  background: var(--card-bg);
}
.code-input { text-align: center; letter-spacing: 10px; font-size: 30px; font-weight: 800; direction: ltr; color: var(--blue-500); }
textarea { resize: vertical; min-height: 110px; line-height: 1.9; }

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 18px; font-size: 15px; font-weight: 800; color: #fff;
  background: linear-gradient(180deg, var(--blue-500), var(--blue-600));
  width: 100%; box-shadow: var(--glow-blue);
}
.btn:hover { filter: brightness(1.06); }
.btn-red  { background: linear-gradient(180deg, var(--red-500), var(--red-600)); box-shadow: var(--glow-red); }
.btn-mint { background: linear-gradient(180deg, var(--mint-500), var(--mint-600)); box-shadow: var(--glow-mint); }
.btn-ghost { background: var(--sub-chip-bg); color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
.btn:disabled { background: #9aa0b8; box-shadow: none; cursor: not-allowed; filter: none; }
[data-theme="dark"] .btn:disabled { background: #333a5e; color: #8d94bd; }

/* ---------- وضعیت‌ها ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.pill-online  { background: rgba(16, 185, 129, 0.16); color: #0e9f68; }
.pill-offline { background: rgba(230, 57, 80, 0.14); color: #e05066; }
.pill-neutral { background: var(--sub-chip-bg); color: var(--muted); }
[data-theme="dark"] .pill-online { color: #3ddba0; }
[data-theme="dark"] .pill-offline { color: #ff7d92; }

.status { margin-top: 10px; font-size: 13px; text-align: center; min-height: 18px; font-weight: 600; }
.ok { color: #0e9f68; }
.err { color: #e05066; }
[data-theme="dark"] .ok { color: #3ddba0; }
[data-theme="dark"] .err { color: #ff7d92; }
.muted { color: var(--muted); font-size: 12px; }

/* ---------- تب‌ها ---------- */
.tabbar { display: flex; gap: 6px; margin-bottom: 14px; background: var(--tab-rail); padding: 5px; border-radius: 15px; }
.tab-btn { flex: 1; padding: 11px 6px; background: transparent; color: var(--tab-ink); font-size: 13.5px; font-weight: 800; border-radius: 11px; }
.tab-btn.active { background: var(--card-bg); color: var(--red-500); box-shadow: var(--shadow-sm); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeUp .24s ease; }
.hidden { display: none !important; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* ---------- جدول ---------- */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; color: var(--ink); }
th, td { padding: 9px 7px; border-bottom: 1px solid var(--line); text-align: start; }
th { color: var(--muted); font-weight: 800; font-size: 11.5px; }

/* ---------- اسکلت لودینگ ---------- */
.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--line) 25%, var(--sub-chip-bg) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

footer { text-align: center; font-size: 11.5px; color: var(--muted); padding: 22px 16px; }
