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

:root {
  --bg:          #f0fdf4;
  --bg-alt:      #ffffff;
  --card:        #ffffff;
  --border:      #d1fae5;
  --border-mid:  #a7f3d0;
  --text:        #0f172a;
  --text-mid:    #334155;
  --text-muted:  #64748b;
  --primary:     #10b981;
  --primary-dk:  #059669;
  --primary-lt:  #ecfdf5;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(240,253,244,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.logo-icon { font-size: 1.4rem; }
.logo-text { font-weight: 700; font-size: 1.1rem; letter-spacing: -.5px; color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.status-badge {
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f1f5f9;
  color: var(--text-muted);
  transition: all .3s;
}
.status-badge.running {
  background: #dcfce7;
  color: #15803d;
}

/* ── Buttons ───────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  font-family: inherit;
}
.btn-primary:hover { background: var(--primary-dk); }
.btn-primary:active { transform: scale(.97); }
.btn-primary.stop { background: #ef4444; }
.btn-primary.stop:hover { background: #dc2626; }

.btn-support {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border-mid);
  padding: 10px 22px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, box-shadow .15s;
  text-decoration: none;
}
.btn-support:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16,185,129,.12);
  text-decoration: none;
}

/* ── Hero ──────────────────────────────────────── */
.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 20px 40px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
}

.hero-alert {
  font-size: 0.95rem;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #78350f;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.notif-buttons {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.btn-allow {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.btn-allow:hover { background: var(--primary-dk); }

.btn-test-notif {
  background: none;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  padding: 8px 18px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s;
}
.btn-test-notif:hover { border-color: var(--primary); color: var(--primary-dk); }

.notif-hint {
  font-size: .78rem;
  color: var(--text-muted);
}

.install-link {
  font-size: .82rem;
  color: var(--text-muted);
  text-decoration: none;
}
.install-link:hover { color: var(--primary); text-decoration: none; }

.btn-support-disabled {
  opacity: .5;
  cursor: default;
}
.btn-support-disabled:hover {
  border-color: var(--border-mid);
  box-shadow: none;
}


/* ── Sections ──────────────────────────────────── */
.section {
  max-width: 860px;
  margin: 0 auto 48px;
  padding: 0 20px;
}

.section-header { margin-bottom: 24px; }
.section-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.4px;
  margin-bottom: 4px;
}
.section-sub { color: var(--text-muted); font-size: .9rem; }

/* ── Reminder Cards ────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.reminder-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .2s, box-shadow .2s, opacity .2s;
  box-shadow: var(--shadow-sm);
}
.reminder-card:hover { border-color: var(--border-mid); box-shadow: var(--shadow-md); }
.reminder-card.disabled { opacity: .55; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-emoji {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.card-meta { flex: 1; }
.card-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.2px;
  margin-bottom: 2px;
}
.card-name-input {
  font-weight: 700;
  font-size: 1rem;
  border: none;
  background: transparent;
  width: 100%;
  font-family: inherit;
  color: var(--text);
  outline: none;
  border-bottom: 1.5px dashed var(--border-mid);
  padding-bottom: 2px;
}
.card-name-input:focus { border-bottom-color: var(--primary); }
.card-desc { font-size: .82rem; color: var(--text-muted); }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #cbd5e1;
  border-radius: 24px;
  cursor: pointer;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Interval selector */
.card-interval {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--text-mid);
}
.card-interval label { white-space: nowrap; }
.interval-select {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .85rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.interval-select:focus { border-color: var(--primary); }

/* Countdown */
.card-countdown {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.countdown-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
  transition: background .3s;
}
.countdown-dot.active { background: var(--primary); animation: pulse 2s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ── Settings ──────────────────────────────────── */
.settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 24px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.time-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.time-group label, .days-group label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.time-sep { color: var(--text-muted); font-size: 1.2rem; padding-bottom: 2px; }

input[type="time"] {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
input[type="time"]:focus { border-color: var(--primary); }

.days-group { display: flex; flex-direction: column; gap: 6px; }
.day-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pill {
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.day-pill.active {
  background: var(--primary-lt);
  border-color: var(--primary);
  color: var(--primary-dk);
}

/* ── Support ───────────────────────────────────── */
.support-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 28px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.support-content { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 220px; }
.support-icon { font-size: 2.4rem; flex-shrink: 0; }
.support-content h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.support-content p { font-size: .88rem; color: var(--text-mid); line-height: 1.6; }

/* ── Products / Affiliate ──────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.product-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .1s;
  box-shadow: var(--shadow-sm);
}
.product-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}

.product-icon { font-size: 1.8rem; flex-shrink: 0; }
.product-info { flex: 1; min-width: 0; }
.product-info strong { display: block; font-size: .9rem; font-weight: 700; }
.product-info span { font-size: .78rem; color: var(--text-muted); }
.product-arrow { color: var(--text-muted); font-size: 1rem; flex-shrink: 0; }

.affiliate-note { font-size: .75rem; color: var(--text-muted); }

/* ── Footer ────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 24px 20px;
}
.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .85rem;
  color: var(--text-muted);
}
.footer-sep { color: var(--border-mid); }

/* ── Toast ─────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  z-index: 1000;
  animation: slide-up .25s ease;
  white-space: nowrap;
}
@keyframes slide-up {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}


/* ── Legal pages ───────────────────────────────── */
.legal-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.legal-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  box-shadow: var(--shadow-sm);
}

.legal-card h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 28px;
}

.legal-card h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 28px 0 8px;
  color: var(--text);
}

.legal-card p, .legal-card li {
  font-size: .92rem;
  color: var(--text-mid);
  line-height: 1.75;
  margin-bottom: 8px;
}

.legal-card ul {
  padding-left: 20px;
  margin-bottom: 8px;
}

.legal-card code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .85em;
}

.legal-nav {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: .82rem !important;
  color: var(--text-muted) !important;
}

.legal-stand {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .legal-card { padding: 24px 20px; }
}

.feedback-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
  text-align: center;
}
.feedback-hint a { color: var(--muted); }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 600px) {
  .hero { padding: 40px 16px 28px; }
  .section { padding: 0 16px; }
  .support-card { flex-direction: column; align-items: flex-start; }
  .settings-row { gap: 16px; }
  .header-inner { padding: 0 16px; }
  .footer-inner { justify-content: center; text-align: center; }
}
