/* ===================================================================
   سامانه رشد و توسعه فردی - استایل اختصاصی بر مبنای DESIGN.md
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Colors - Organic Botanical Palette */
  --bg-app: #f8f6f0;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f0ebe1;
  --bg-surface-elevated: #ffffff;

  --text-main: #222c24;
  --text-muted: #566759;
  --text-subtle: #849687;

  --primary-50: #eff6f1;
  --primary-100: #d8ecde;
  --primary-200: #b5d9be;
  --primary-500: #2d5a3f;
  --primary-600: #224731;
  --primary-700: #173323;
  --primary-fg: #ffffff;

  --accent-50: #fdf5f0;
  --accent-100: #fae6dc;
  --accent-500: #d97746;
  --accent-600: #be6336;
  --accent-fg: #ffffff;

  --success: #2e7d47;
  --success-bg: #eaf6ee;
  --success-border: #a3d9b4;

  --danger: #c54a3e;
  --danger-bg: #fdf0ee;
  --danger-border: #f5c4be;

  --border-light: rgba(45, 90, 63, 0.12);
  --border-focus: #2d5a3f;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-subtle: 0 2px 10px rgba(34, 44, 36, 0.04);
  --shadow-card: 0 6px 24px -4px rgba(34, 44, 36, 0.07);
  --shadow-elevated: 0 16px 36px -6px rgba(34, 44, 36, 0.1);

  /* Transitions */
  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background Soft Atmosphere */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 380px;
  background: radial-gradient(circle at 80% 20%, rgba(216, 236, 222, 0.45) 0%, rgba(248, 246, 240, 0) 70%),
              radial-gradient(circle at 20% 40%, rgba(250, 230, 220, 0.3) 0%, rgba(248, 246, 240, 0) 60%);
  pointer-events: none;
  z-index: -1;
}

/* Typography Helpers */
h1, h2, h3, h4, h5 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.35;
}

p {
  color: var(--text-muted);
}

a {
  color: var(--primary-500);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--primary-600);
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* App Header */
.app-header {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-sm) 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-100), var(--primary-50));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid var(--border-light);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary-700);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-subtle);
}

/* Header User Profile & Group Badge */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.group-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background-color: var(--primary-50);
  color: var(--primary-700);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-subtle);
}

.group-badge .symbol {
  font-size: 16px;
}

.nav-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-subtle);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-link-btn:hover {
  background-color: var(--primary-100);
  color: var(--primary-700);
}

.btn-logout {
  color: var(--danger);
  background: transparent;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-logout:hover {
  background-color: var(--danger-bg);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: var(--space-xl) 0 var(--space-2xl);
}

/* Cards */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: var(--space-sm);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card-title-icon {
  font-size: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.card-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background-color: var(--primary-50);
  color: var(--primary-600);
  font-weight: 600;
}

/* Section: Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f4f9f5 100%);
  border: 1px solid rgba(45, 90, 63, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.welcome-info h1 {
  font-size: 24px;
  margin-bottom: 6px;
  color: var(--primary-700);
}

.welcome-info p {
  font-size: 14px;
  color: var(--text-muted);
}

.welcome-date-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 4px 12px;
  background-color: rgba(45, 90, 63, 0.08);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-600);
}

.welcome-plant-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, #e2f0e6 0%, #c6e4cf 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
  border: 3px solid #ffffff;
  animation: floatSlow 4s ease-in-out infinite;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Section: Daily Commitments (قرارهای روز) */
.commitments-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.commitment-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px 18px;
  background-color: var(--bg-surface-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(45, 90, 63, 0.06);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.commitment-item:hover {
  background-color: #f7f4ee;
  transform: translateX(-4px);
}

.commitment-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--primary-500);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.commitment-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  flex: 1;
}

/* =============================================================
   Looping Completion Garden Card (هنگام ثبت پاسخ‌ها)
   ============================================================= */
.completed-garden-card {
  background: linear-gradient(135deg, #ffffff 0%, #f2f8f4 100%);
  border: 2px solid var(--primary-100);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.garden-pulse-badge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, #e6f4ea 0%, #c4e4ce 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin-bottom: var(--space-md);
  box-shadow: 0 0 0 0 rgba(45, 90, 63, 0.4);
  animation: gardenBreathe 3s ease-in-out infinite;
  border: 3px solid #ffffff;
}

@keyframes gardenBreathe {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(45, 90, 63, 0.35);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 16px rgba(45, 90, 63, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(45, 90, 63, 0);
  }
}

.garden-complete-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--primary-700);
  margin-bottom: 8px;
}

.garden-complete-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 18px;
  line-height: 1.6;
}

.garden-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid var(--primary-200);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-700);
  box-shadow: var(--shadow-subtle);
  margin-bottom: var(--space-lg);
}

.garden-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* =============================================================
   Interactive Questionnaire (سوال‌های روزانه)
   ============================================================= */
.questions-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-elevated);
}

.question-progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  position: relative;
}

.progress-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background-color: var(--bg-surface-subtle);
  transform: translateY(-50%);
  z-index: 1;
}

.progress-track-fill {
  height: 100%;
  background-color: var(--primary-500);
  transition: width var(--transition-smooth);
}

.progress-steps {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  border: 2px solid var(--border-light);
  color: var(--text-subtle);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-smooth);
}

.step-dot.active {
  border-color: var(--primary-500);
  background-color: var(--primary-500);
  color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 0 4px var(--primary-100);
}

.step-dot.completed {
  border-color: var(--primary-500);
  background-color: var(--primary-100);
  color: var(--primary-700);
}

.question-box {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-lg) 0;
}

.question-title-badge {
  font-size: 13px;
  color: var(--accent-600);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.question-text {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-main);
  max-width: 620px;
  line-height: 1.6;
  margin-bottom: var(--space-xl);
}

/* Binary Answer Buttons (بله / خیر) */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  width: 100%;
  max-width: 440px;
}

.btn-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  transition: transform 120ms ease, background-color 150ms ease, border-color 150ms ease, color 150ms ease;
  box-shadow: var(--shadow-subtle);
  background: var(--bg-surface-subtle);
  color: var(--text-main);
  user-select: none;
}

.btn-option .opt-icon {
  font-size: 26px;
  transition: transform 150ms ease;
}

.btn-option:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.btn-option:hover .opt-icon {
  transform: scale(1.15);
}

.btn-option-yes {
  background-color: var(--primary-50);
  border-color: var(--primary-200);
  color: var(--primary-700);
}

.btn-option-yes.selected {
  background-color: var(--primary-500) !important;
  border-color: var(--primary-600) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(45, 90, 63, 0.25);
}

.btn-option-no {
  background-color: var(--accent-50);
  border-color: var(--accent-100);
  color: var(--accent-600);
}

.btn-option-no.selected {
  background-color: var(--accent-500) !important;
  border-color: var(--accent-600) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(217, 119, 70, 0.25);
}

.question-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.btn-secondary {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-secondary:hover:not(:disabled) {
  background-color: #e5ded3;
  color: var(--text-main);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =============================================================
   6 Growth Stages Tracker
   ============================================================= */
.growth-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-lg);
}

.growth-stages-tracker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: var(--space-md);
  position: relative;
}

@media (max-width: 680px) {
  .growth-stages-tracker {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stage-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 6px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-subtle);
  border: 2px solid transparent;
  transition: all var(--transition-smooth);
}

.stage-step .stage-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-subtle);
  border: 1px solid var(--border-light);
  transition: transform var(--transition-fast);
}

.stage-step.active {
  background-color: #f1f8f3;
  border-color: var(--primary-500);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.stage-step.active .stage-icon-wrap {
  background: linear-gradient(135deg, var(--primary-100), var(--primary-50));
  border-color: var(--primary-500);
  transform: scale(1.1);
}

.stage-step.past {
  background-color: #faf8f3;
  opacity: 0.85;
}

.stage-step.locked {
  background-color: #f5f2eb;
  opacity: 0.7;
}

.stage-step.locked .stage-icon-wrap {
  background: #ebe5d8;
  color: #8c9c8e;
  border-color: transparent;
  font-size: 18px;
}

.stage-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.stage-days-req {
  font-size: 11px;
  color: var(--text-subtle);
}

.growth-summary-box {
  margin-top: var(--space-md);
  padding: 14px 18px;
  background: linear-gradient(135deg, #f7faf7 0%, #eff7f1 100%);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(45, 90, 63, 0.15);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.growth-summary-icon {
  font-size: 32px;
}

.growth-summary-text {
  font-size: 13.5px;
  color: var(--text-muted);
}
.growth-summary-text strong {
  color: var(--primary-700);
}

/* =============================================================
   صفحه تحلیل و نمودارها (Analytics & Results Page)
   ============================================================= */

.score-hero-card {
  background: linear-gradient(135deg, #2d5a3f 0%, #1e402c 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.score-hero-info h1 {
  color: #ffffff;
  font-size: 24px;
  margin-bottom: 8px;
}

.score-hero-info p {
  color: #cde6d4;
  font-size: 14px;
}

.score-circle-badge {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 3px solid rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.score-percent-val {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.score-percent-label {
  font-size: 11px;
  color: #e2f0e6;
  margin-top: 4px;
}

/* Charts Wrapper */
.chart-container {
  width: 100%;
  position: relative;
  margin-top: var(--space-md);
  overflow-x: auto;
}

.chart-canvas {
  width: 100%;
  height: 280px;
  display: block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.legend-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-item.highlight-mine {
  font-weight: 700;
  color: var(--primary-700);
  background: var(--primary-50);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--primary-200);
}

/* Action Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--primary-500);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background-color: var(--primary-600);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Login Page Styles */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-elevated);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
}

.login-logo {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-100), var(--primary-50));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: var(--space-md);
  border: 1px solid var(--border-light);
}

.login-form {
  margin-top: var(--space-xl);
  text-align: right;
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  background-color: var(--bg-surface-subtle);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--primary-500);
  background-color: #ffffff;
}

.demo-users-box {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px dashed var(--border-light);
  text-align: center;
}

.demo-title {
  font-size: 12px;
  color: var(--text-subtle);
  margin-bottom: var(--space-sm);
}

.demo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.demo-chip {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
}
.demo-chip:hover {
  background-color: var(--primary-100);
  color: var(--primary-700);
}

/* Responsive Breakpoints */
@media (max-width: 680px) {
  .welcome-banner {
    flex-direction: column-reverse;
    text-align: center;
    padding: var(--space-lg);
  }
  .welcome-info {
    text-align: center;
  }
  .score-hero-card {
    flex-direction: column;
    text-align: center;
  }
  .options-grid {
    grid-template-columns: 1fr;
  }
  .header-inner {
    flex-wrap: wrap;
  }
}
