/* === APP SHARED STYLES === */
/* Inherits theme tokens from theme.css and adds app-specific styles */

.app-page { background: var(--bg); }

/* === NAV === */
.app-nav {
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(28, 61, 58, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.app-nav .nav-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.nav-actions { padding-right: 2rem; }
.btn-ghost {
  background: none;
  border: 1px solid rgba(28, 61, 58, 0.2);
  padding: 0.4rem 1rem;
  border-radius: 0.3rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s;
}
.btn-ghost:hover { background: var(--bg-alt); }

/* === APP CONTAINER === */
.app-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
}

/* === PHASE BANNER === */
.phase-banner {
  background: var(--green-deep);
  color: var(--bg);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.phase-info { display: flex; flex-direction: column; gap: 0.2rem; }
.phase-badge {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--bg);
}
.phase-day { font-size: 0.78rem; color: rgba(253,249,245,0.65); }
.phase-dots { display: flex; gap: 0.4rem; align-items: center; }
.phase-dot-nav {
  width: 10px; height: 10px;
  border-radius: 50%;
  opacity: 0.35;
  transition: opacity 0.3s;
}
.phase-dot-nav.active { opacity: 1; transform: scale(1.3); }
.phase-dot-nav.menstrual { background: var(--phase-menstrual); }
.phase-dot-nav.follicular { background: var(--phase-follicular); }
.phase-dot-nav.ovulation { background: var(--phase-ovulation); }
.phase-dot-nav.luteal { background: var(--phase-luteal); }

/* === INSIGHT CARD === */
.insight-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(28, 61, 58, 0.07);
  box-shadow: 0 1px 4px rgba(28,61,58,0.04);
}
.insight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.insight-eyebrow {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.insight-refresh {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--fg-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  transition: background 0.2s;
}
.insight-refresh:hover { background: var(--bg-alt); }
.insight-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--fg-muted);
  font-size: 0.9rem;
}
.loading-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(28,61,58,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.insight-phase-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--green-deep);
  margin-bottom: 0.5rem;
}
.insight-phase-desc {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}
.insight-today-expect {
  background: var(--bg-alt);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--fg);
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--accent);
}
.insight-suggestions { display: flex; flex-direction: column; gap: 0.75rem; }
.insight-suggestion {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 0.5rem;
  border: 1px solid rgba(28,61,58,0.05);
}
.insight-suggestion-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.insight-suggestion-content {}
.insight-suggestion-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 0.15rem;
}
.insight-suggestion-body {
  font-size: 0.82rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* === TABS === */
.app-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid rgba(28,61,58,0.08);
  margin-bottom: 1.5rem;
}
.app-tab {
  background: none;
  border: none;
  padding: 0.6rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--fg-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.app-tab.active {
  color: var(--green-deep);
  font-weight: 500;
  border-bottom-color: var(--green-deep);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === SECTIONS === */
.log-section {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(28,61,58,0.06);
}
.section-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--green-deep);
  margin-bottom: 1rem;
}

/* === FLOW BUTTONS === */
.flow-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
.flow-btn {
  background: var(--bg);
  border: 1px solid rgba(28,61,58,0.1);
  border-radius: 0.5rem;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-family: var(--font-body);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.flow-btn:hover { border-color: var(--accent); color: var(--accent); }
.flow-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.flow-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--sage);
}
.flow-indicator {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sage);
}

/* === SYMPTOM LOGGING === */
.symptom-group { margin-bottom: 1.25rem; }
.symptom-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}
.symptom-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.symptom-btn {
  background: var(--bg);
  border: 1px solid rgba(28,61,58,0.12);
  border-radius: 2rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-family: var(--font-body);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.symptom-btn:hover { border-color: var(--accent); color: var(--accent); }
.symptom-btn.selected {
  background: var(--green-mid);
  border-color: var(--green-mid);
  color: white;
}

.symptom-slider {
  width: 100%;
  accent-color: var(--accent);
  margin: 0.3rem 0;
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--fg-muted);
}
.symptom-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(28,61,58,0.12);
  border-radius: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--fg);
  background: var(--bg);
}
.symptom-textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem;
  border: 1px solid rgba(28,61,58,0.12);
  border-radius: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--fg);
  background: var(--bg);
  resize: vertical;
  line-height: 1.6;
}
.symptom-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* === BUTTONS === */
.btn-primary {
  display: block;
  width: 100%;
  background: var(--green-deep);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}
.btn-primary:hover { background: var(--green-mid); }
.save-status { margin-top: 0.5rem; text-align: center; }
.save-ok { font-size: 0.82rem; color: var(--sage); }

/* === CYCLE CALENDAR === */
.cycle-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  border-radius: 0.4rem;
  background: var(--bg-alt);
  color: var(--fg-muted);
}
.calendar-day.bleeding { background: var(--phase-menstrual); color: white; }
.calendar-day.fertile { background: rgba(196,112,79,0.2); }
.calendar-day .day-num { font-weight: 500; }
.calendar-day .day-label { font-size: 0.6rem; opacity: 0.8; }
.cycle-legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 1rem;
  align-items: center;
}
.legend-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 0.3rem;
}
.legend-dot.menstrual { background: var(--phase-menstrual); }
.legend-dot.fertile { background: rgba(196,112,79,0.4); }

/* === HISTORY === */
.history-list { display: flex; flex-direction: column; gap: 0.75rem; }
.history-entry {
  background: white;
  border: 1px solid rgba(28,61,58,0.06);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
}
.history-date {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.history-symptoms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.history-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
  background: var(--bg-alt);
  color: var(--fg-muted);
}
.history-tag.bleeding-tag { background: rgba(212,130,122,0.15); color: var(--phase-menstrual); }

/* === ONBOARDING === */
.onboarding-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.onboarding-container {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}
.onboarding-card {
  background: white;
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  width: 100%;
  box-shadow: 0 4px 20px rgba(28,61,58,0.06);
  border: 1px solid rgba(28,61,58,0.04);
}
.onboarding-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--green-deep);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}
.onboarding-tagline {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-bottom: 2rem;
}
.onboarding-card h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--green-deep);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.onboarding-sub {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}
.onboarding-form { display: flex; flex-direction: column; gap: 1rem; }
.onboarding-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 1.5rem;
}
.onboarding-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-muted);
}
.form-group input,
.form-group select {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(28,61,58,0.12);
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-error {
  font-size: 0.82rem;
  color: #C45F5F;
  padding: 0.5rem;
  background: rgba(196,95,95,0.05);
  border-radius: 0.3rem;
  text-align: center;
}

/* Goal options */
.goal-options { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.goal-option input { display: none; }
.goal-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1.5px solid rgba(28,61,58,0.1);
  border-radius: 0.6rem;
  cursor: pointer;
  transition: all 0.2s;
}
.goal-option input:checked + .goal-card {
  border-color: var(--accent);
  background: rgba(196,112,79,0.04);
}
.goal-card:hover { border-color: var(--accent); }
.goal-icon { font-size: 1.5rem; flex-shrink: 0; }
.goal-text { display: flex; flex-direction: column; gap: 0.15rem; }
.goal-text strong { font-size: 0.95rem; color: var(--fg); }
.goal-text span { font-size: 0.78rem; color: var(--fg-muted); }
.back-link { color: var(--fg-muted); text-decoration: none; font-size: 0.85rem; }
.back-link:hover { color: var(--fg); }

/* Phase circles visual */
.phase-circles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.phase-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
}
.phase-dot.menstrual { background: var(--phase-menstrual); }
.phase-dot.follicular { background: var(--phase-follicular); }
.phase-dot.ovulation { background: var(--phase-ovulation); }
.phase-dot.luteal { background: var(--phase-luteal); }

/* === DISCLAIMER === */
.app-disclaimer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--fg-muted);
  padding: 1.5rem;
  border-top: 1px solid rgba(28,61,58,0.06);
  margin-top: 2rem;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .flow-options { grid-template-columns: repeat(2, 1fr); }
  .app-container { padding: 1rem 1rem 4rem; }
  .onboarding-card { padding: 2rem 1.5rem; }
  .phase-banner { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
  .cycle-calendar { gap: 2px; }
}