/* =========================================================
   ADHD Cleaning Planner — style.css
   Minimalist, responsive. Derived from the source PDF's
   color palette. No icons/illustrations — color + type only.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Palette pulled from the PDF's section-header colors */
  --coral:    #E88C82;
  --orange:   #F2A968;
  --gold:     #EFC873;
  --sage:     #A9C2A0;
  --teal:     #8FB6BB;
  --lavender: #B69FD6;

  /* Neutrals */
  --ink:        #2B2B2B;
  --ink-soft:   #5A5A5A;
  --paper:      #FFFFFF;
  --paper-dim:  #FAFAF9;
  --line:       #E7E5E2;

  /* Type */
  --font-display: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;

  /* Layout */
  --max-width: 1080px;
  --radius: 10px;
  --radius-sm: 6px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;

  --shadow-sm: 0 1px 2px rgba(43,43,43,0.06);
  --shadow-md: 0 4px 16px rgba(43,43,43,0.08);

  /* Card background — same as container in light mode; dark mode
     gives it its own lighter shade for contrast (see override below) */
  --paper-card: var(--paper);
}

/* Dark theme — same tokens, different values. Everything built with
   var(--...) automatically follows this, no per-component overrides. */
:root[data-theme="dark"] {
  --ink:        #EDEDED;
  --ink-soft:   #A6A6AA;
  --paper:      #1E1E22;
  --paper-dim:  #141416;
  --paper-card: #2C2C33;
  --line:       #3E3E46;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper-dim);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 var(--space-2);
  line-height: 1.2;
}
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p  { margin: 0 0 var(--space-2); color: var(--ink-soft); }
a  { color: var(--ink); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Page shell: one bounded container ---------- */
body {
  background: var(--paper-dim);
}

.app-container {
  max-width: var(--max-width);
  margin: var(--space-4) auto;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.app-nav-bar {
  position: relative;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  border-bottom: 1px solid var(--line);
}

/* Night Mode toggle — top-right corner of the nav bar */
.theme-toggle {
  position: absolute;
  top: var(--space-2);
  right: var(--space-3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.theme-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.theme-toggle__track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--line);
  transition: background-color 0.15s ease;
  flex: none;
}
.theme-toggle__track::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}
.theme-toggle input:checked + .theme-toggle__track {
  background: var(--teal);
}
.theme-toggle input:checked + .theme-toggle__track::before {
  transform: translateX(16px);
}
.theme-toggle input:focus-visible + .theme-toggle__track {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.site-logo-link {
  display: inline-block;
}
.site-logo-placeholder {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper-dim);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.4;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 0.6rem;
  row-gap: 0.4rem;
  font-size: 0.95rem;
}
.site-nav a,
.site-nav span {
  position: relative;
  padding: 0.2rem 0.6rem;
}
.site-nav a + a::before,
.site-nav a + span::before,
.site-nav span + a::before {
  content: "\00B7";
  position: absolute;
  left: -0.5rem;
  color: var(--line);
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.35rem 0.1rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--coral);
}

.app-content {
  padding: var(--space-4) var(--space-3);
}

.app-footer {
  padding: var(--space-3);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
}
.app-footer a { color: var(--ink-soft); }

/* ---------- Section header bars (signature element) ----------
   Solid color-block bars, rotating through the palette, echoing
   the PDF's category headers. cycle 1–6 to auto-rotate colors. */
.section-header {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.section-header--1 { background: var(--coral); }
.section-header--2 { background: var(--orange); }
.section-header--3 { background: var(--gold); }
.section-header--4 { background: var(--sage); }
.section-header--5 { background: var(--teal); }
.section-header--6 { background: var(--lavender); }

/* ---------- Cards ---------- */
.card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--space-3); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}

/* ---------- Checklist items ----------
   Rounded-square checkboxes echoing the PDF's task lines. */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.25rem;
  border-bottom: 1px solid var(--line);
}
.checklist__item:last-child { border-bottom: none; }

.checklist__box {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 0.1rem;
  border: 2px solid var(--ink-soft);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.checklist__box:checked {
  background: var(--sage);
  border-color: var(--sage);
}
.checklist__box:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid var(--paper);
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}

.checklist__label {
  flex: 1;
  cursor: pointer;
  color: var(--ink);
}
.checklist__box:checked + .checklist__label {
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-color: var(--ink-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--coral);
  color: var(--ink);
}
.btn--primary:hover { box-shadow: var(--shadow-md); }

.btn--secondary {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
}
.btn--secondary:hover { border-color: var(--ink-soft); }

.btn--full { width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: var(--space-2); }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
}

/* Password field with a show/hide eye-icon toggle */
.field--password { position: relative; }
.field--password input {
  padding-right: 2.75rem;
}
.field__toggle {
  position: absolute;
  right: 0.5rem;
  top: 2.05rem;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0;
  color: var(--ink-soft);
  cursor: pointer;
}
.field__toggle:hover { color: var(--ink); background: var(--paper-dim); }
.field__toggle svg { width: 20px; height: 20px; }
.field__toggle .icon-eye-off { display: none; }
.field__toggle[data-visible="true"] .icon-eye { display: none; }
.field__toggle[data-visible="true"] .icon-eye-off { display: block; }

/* Choice chips — for quiz screens (priorities, energy level, etc.) */
.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
  font-size: 0.9rem;
}
.choice-chip input { accent-color: var(--coral); }
.choice-chip:has(input:checked) {
  border-color: var(--coral);
  background: color-mix(in srgb, var(--coral) 12%, var(--paper));
}

/* ---------- Progress / streak pill ---------- */
.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
}

/* ---------- Calendar ---------- */
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: var(--space-2);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.calendar-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-weekday {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding: 0.4rem 0;
}
.calendar-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 0.4rem 0.2rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
}
.calendar-cell:hover { border-color: var(--coral); }
.calendar-cell--empty { border: none; background: transparent; }
.calendar-cell--today {
  border-color: var(--coral);
  border-width: 2px;
  font-weight: 700;
}
.calendar-cell__num { font-size: 0.9rem; }
.calendar-cell__dots { display: flex; gap: 4px; }

.calendar-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid transparent;
}
.calendar-dot--daily   { border-color: var(--coral);    background: color-mix(in srgb, var(--coral) 25%, transparent); }
.calendar-dot--weekly  { border-color: var(--orange);   background: color-mix(in srgb, var(--orange) 25%, transparent); }
.calendar-dot--monthly { border-color: var(--lavender); background: color-mix(in srgb, var(--lavender) 25%, transparent); }
.calendar-dot--filled.calendar-dot--daily   { background: var(--coral); }
.calendar-dot--filled.calendar-dot--weekly  { background: var(--orange); }
.calendar-dot--filled.calendar-dot--monthly { background: var(--lavender); }

.calendar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  z-index: 100;
}
.calendar-panel {
  background: var(--paper-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: var(--space-3);
  position: relative;
}
.calendar-panel__close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-soft);
  text-decoration: none;
}
.calendar-panel__close:hover { color: var(--ink); }

/* ---------- Info tooltip (tap-to-reveal, no JS) ---------- */
.info-tip {
  display: inline-block;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.info-tip summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: var(--paper);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.info-tip summary::-webkit-details-marker { display: none; }
.info-tip summary::marker { content: ""; }
.info-tip summary:hover { background: var(--coral); }
.info-tip p {
  margin: 0.5rem 0 0;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: var(--paper-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--ink-soft); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: var(--space-2); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .app-nav-bar { padding: var(--space-2); }
  .site-nav { gap: var(--space-1); font-size: 0.85rem; }
  .app-content { padding: var(--space-3) var(--space-2); }
  .card { padding: var(--space-2); }
}
