/* ===== FMS FIT — Design System ===== */
:root {
  --bg: #08090b;
  --bg-alt: #0d0f12;
  --card: #121417;
  --card-border: rgba(255, 255, 255, 0.07);
  --gold: #f2c230;
  --gold-dim: #b8931f;
  --text: #f4f4f2;
  --text-dim: #a3a6ab;
  --text-faint: #6b6e73;
  --danger: #e0563f;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --font: "Tajawal", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  margin: 0 0 10px;
  text-transform: uppercase;
}

/* ===== الشريط العلوي ===== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 18px 0;
  transition: all 0.35s ease;
  background: transparent;
}
.site-header.scrolled {
  padding: 12px 0;
  background: rgba(8, 9, 11, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 1px;
  display: inline-flex;
  gap: 6px;
}
.brand-mark { color: var(--text); }
.brand-sub { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 34px;
}
.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.2s ease;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.25s ease;
}
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== الهيرو ===== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: radial-gradient(120% 90% at 75% 20%, #171a1f 0%, var(--bg) 60%);
}
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-glow {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 60vw;
  height: 60vw;
  max-width: 700px;
  max-height: 700px;
  background: radial-gradient(circle, rgba(242, 194, 48, 0.16) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 50px;
  padding-top: 90px;
}

.hero-text h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 900;
  margin: 6px 0 0;
  line-height: 1;
  letter-spacing: 1px;
}
.hero-text h1 .accent { color: var(--gold); }

.hero-tagline {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 14px 0 6px;
}
.hero-desc {
  color: var(--text-dim);
  max-width: 480px;
  font-size: 1rem;
  margin: 0 0 30px;
}

.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 30px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--gold);
  color: #14140f;
  box-shadow: 0 10px 30px rgba(242, 194, 48, 0.25);
}
.btn-primary:hover { box-shadow: 0 14px 34px rgba(242, 194, 48, 0.4); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--card-border);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn-block { width: 100%; margin-top: 8px; }

.hero-photo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-photo-frame {
  position: relative;
  width: min(360px, 80vw);
  aspect-ratio: 3 / 4;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(242, 194, 48, 0.25);
  box-shadow: var(--shadow);
  background: linear-gradient(160deg, #1a1c20, #0b0c0e);
}
.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.15) contrast(1.05);
}
.hero-photo-ring {
  position: absolute;
  inset: -16px;
  border: 1px dashed rgba(242, 194, 48, 0.3);
  border-radius: 32px;
  pointer-events: none;
  z-index: -1;
}

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--text-faint);
  border-radius: 20px;
  z-index: 1;
}
.scroll-hint span {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--gold);
  border-radius: 4px;
  animation: scrollDown 1.8s ease-in-out infinite;
}
@keyframes scrollDown {
  0% { opacity: 0; top: 6px; }
  30% { opacity: 1; }
  80% { opacity: 0; top: 20px; }
  100% { opacity: 0; top: 6px; }
}

/* ===== أقسام عامة ===== */
.section { padding: 110px 0; }
.section-alt { background: var(--bg-alt); }
.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 56px;
}
.section-head h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 900;
  margin: 0 0 14px;
}
.section-desc { color: var(--text-dim); font-size: 1.02rem; margin: 0; }

/* ===== شبكة الجدول ===== */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 20px;
}

.day-card {
  background: linear-gradient(160deg, var(--card), #0c0d10);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.day-card:hover {
  transform: translateY(-6px);
  border-color: rgba(242, 194, 48, 0.35);
  box-shadow: var(--shadow);
}
.day-card.is-done { border-color: rgba(242, 194, 48, 0.55); }
.day-card.is-done::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(120% 60% at 100% 0%, rgba(242, 194, 48, 0.08), transparent 60%);
  pointer-events: none;
}

.day-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.day-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}
.intensity-high .day-badge { background: rgba(224, 86, 63, 0.15); color: #f18a76; }
.intensity-medium .day-badge { background: rgba(242, 194, 48, 0.15); color: var(--gold); }
.intensity-low .day-badge { background: rgba(88, 166, 255, 0.15); color: #7db3ff; }
.intensity-off .day-badge { background: rgba(255, 255, 255, 0.05); color: var(--text-faint); }

.day-icon { width: 26px; height: 26px; color: var(--gold); opacity: 0.85; }

.day-name { margin: 0 0 4px; font-size: 1.35rem; font-weight: 800; }
.day-group { margin: 0 0 6px; color: var(--text); font-weight: 700; font-size: 1rem; }
.day-note { margin: 0 0 16px; color: var(--text-dim); font-size: 0.9rem; min-height: 40px; }

.day-log-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid var(--card-border);
}
.day-log-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 4px 0;
}
.day-log-list li span:first-child { color: var(--text); font-weight: 600; }

.day-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.btn-log {
  background: rgba(242, 194, 48, 0.1);
  color: var(--gold);
  border: 1px solid rgba(242, 194, 48, 0.3);
  padding: 9px 16px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-log:hover { background: rgba(242, 194, 48, 0.2); }

.btn-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.btn-check input { accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer; }

/* ===== الإحصائيات ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.stat-big {
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}
.stat-label { color: var(--text-dim); font-size: 0.9rem; margin: 0; }

.progress-ring {
  position: relative;
  width: 120px;
  height: 120px;
}
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 10;
}
.ring-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}
.stat-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}

/* ===== نافذة إضافة تمرين ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-box {
  width: min(420px, 92vw);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow);
  transform: translateY(10px);
  transition: transform 0.25s ease;
}
.modal.open .modal-box { transform: translateY(0); }
.modal-box h3 { margin: 0 0 4px; font-size: 1.4rem; }
.modal-day { color: var(--gold); font-weight: 700; margin: 0 0 20px; font-size: 0.9rem; }

.modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}

#log-form label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 14px 0 6px;
  font-weight: 600;
}
#log-form input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
}
#log-form input:focus {
  outline: none;
  border-color: var(--gold);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* ===== الفوتر ===== */
.site-footer {
  padding: 30px 0;
  border-top: 1px solid var(--card-border);
  background: var(--bg-alt);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.footer-note { color: var(--text-faint); }

/* ===== استجابة الشاشات ===== */
@media (max-width: 900px) {
  .site-header { padding-top: calc(16px + env(safe-area-inset-top)); }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: calc(78px + env(safe-area-inset-top));
    padding-bottom: 40px;
    gap: 30px;
  }
  .hero-desc { margin-inline: auto; }
  .hero-cta { justify-content: center; }

  .hero-photo-frame { width: min(240px, 58vw); }

  .btn { padding: 14px 26px; }

  .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: rgba(8, 9, 11, 0.97);
    flex-direction: column;
    padding: 12px 24px calc(20px + env(safe-area-inset-bottom));
    gap: 4px;
    display: none;
    border-bottom: 1px solid var(--card-border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 4px; font-size: 1.02rem; }
  .nav-toggle { display: flex; }

  .stats-row { grid-template-columns: 1fr; }

  .section { padding: 70px 0; }
  .section-head { margin-bottom: 40px; }

  .schedule-grid { grid-template-columns: 1fr; }

  .day-card:hover { transform: none; }
  .day-actions { flex-wrap: wrap; }

  .site-footer { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .hero-text h1 { letter-spacing: 0; }
  .modal-box { padding: 26px 22px; }
}

/* منع تكبير iOS التلقائي عند التركيز على الحقول */
@media (max-width: 900px) {
  #log-form input { font-size: 16px; }
}
