/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --purple:      #6d28d9;
  --purple-dark: #4c1d95;
  --purple-mid:  #7c3aed;
  --purple-soft: #ede9fe;
  --indigo:      #4f46e5;
  --text:        #1e1b4b;
  --text-muted:  #6b7280;
  --border:      #e5e7eb;
  --bg:          #f9f8ff;
  --white:       #ffffff;
  --green:       #059669;
  --red:         #dc2626;
  --radius:      12px;
  --shadow:      0 4px 24px rgba(109,40,217,0.10);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

/* ── Typography ───────────────────────────────────────────────────────────── */
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; letter-spacing: -1px; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.5px; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--text-muted); }
em { font-style: normal; color: var(--purple-mid); }

/* ── Logo ─────────────────────────────────────────────────────────────────── */
.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.logo span { color: var(--purple-mid); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple) 0%, var(--indigo) 100%);
  color: #fff;
  border-color: transparent;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:active { transform: none; opacity: 1; }
.btn-secondary {
  background: var(--purple-soft);
  color: var(--purple);
  border-color: var(--purple-soft);
}
.btn-secondary:hover { background: #ddd6fe; border-color: #ddd6fe; }
.btn-outline {
  background: transparent;
  color: var(--purple);
  border-color: var(--purple);
}
.btn-outline:hover { background: var(--purple-soft); }
.btn-lg { font-size: 1.1rem; padding: 14px 36px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249,248,255,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--purple); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 100px 24px 80px;
  text-align: center;
}
.hero-inner { position: relative; z-index: 2; max-width: 680px; margin: 0 auto; }

.badge {
  display: inline-block;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 99px;
  margin-bottom: 24px;
}

.hero h1 { margin-bottom: 20px; }
.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* Decorative bubbles */
.hero-graphic { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.bubble {
  position: absolute;
  border-radius: 50%;
  opacity: 0.18;
  filter: blur(60px);
}
.b1 { width: 400px; height: 400px; background: var(--purple); top: -100px; right: -80px; }
.b2 { width: 300px; height: 300px; background: var(--indigo); bottom: -60px; left: -60px; }
.b3 { width: 200px; height: 200px; background: #ec4899; top: 30%; left: 40%; }

/* ── Sections ─────────────────────────────────────────────────────────────── */
.section { padding: 80px 24px; }
.section-form { background: linear-gradient(180deg, var(--white) 0%, var(--purple-soft) 100%); }
.section-title { text-align: center; margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--text-muted); margin-bottom: 36px; }

.container { max-width: 1100px; margin: 0 auto; }
.container-narrow { max-width: 600px; margin: 0 auto; }

/* ── Steps ────────────────────────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.step {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.step-icon { font-size: 2.4rem; margin-bottom: 16px; }
.step h3 { margin-bottom: 10px; }

/* ── Card ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  margin-top: 32px;
}

/* ── Form ─────────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 22px; }
.field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.char-count { text-align: right; }

input[type="email"],
input[type="date"],
input[type="time"],
input[type="text"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--purple-mid);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
input.invalid, textarea.invalid, select.invalid {
  border-color: var(--red);
}
textarea { resize: vertical; min-height: 110px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chip {
  padding: 4px 10px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.chip:hover {
  border-color: var(--purple-mid);
  color: var(--purple-mid);
}
.chip.active {
  border-color: var(--purple-mid);
  background: var(--purple-mid);
  color: #fff;
}
.app-module-tabs { margin-bottom: 32px; }
.adjust-chips { margin-top: 6px; display: none; }
.adjust-chips.visible { display: flex; }
.chip-sub { border-color: #fca5a5; color: #ef4444; }
.chip-sub:hover { border-color: #ef4444; background: #fef2f2; color: #ef4444; }
.chip-add { border-color: #86efac; color: #16a34a; }
.chip-add:hover { border-color: #16a34a; background: #f0fdf4; color: #16a34a; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-row.no-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.field-row.no-wrap .field { margin-bottom: 0; }

/* ── Alert ────────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
}
.alert-error { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: var(--green); border: 1px solid #a7f3d0; }

/* ── Success card ─────────────────────────────────────────────────────────── */
.success-card { text-align: center; padding: 52px 36px; }
.success-icon { font-size: 3rem; margin-bottom: 16px; }
.success-card h3 { font-size: 1.4rem; margin-bottom: 10px; }
.success-card p { margin-bottom: 28px; max-width: 380px; margin-left: auto; margin-right: auto; }

/* ── Reminder list ────────────────────────────────────────────────────────── */
.reminder-list { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.reminder-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
}
.reminder-item.sent { opacity: 0.5; }
.reminder-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.reminder-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.badge-pending { background: var(--purple-soft); color: var(--purple); }
.badge-sent    { background: #ecfdf5; color: var(--green); }
.cancel-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.cancel-btn:hover { background: #fef2f2; color: var(--red); }
.delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.delete-btn:hover { background: #fef2f2; color: var(--red); }
.edit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.edit-btn:hover { background: var(--purple-soft); color: var(--purple); }
.reminder-list-empty { color: var(--text-muted); font-size: 0.9rem; padding: 16px 0; text-align: center; }

/* ── Wash Sale Tracker ────────────────────────────────────────────────────── */
.wash-sale-intro {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: -8px 0 24px;
}
.wash-sale-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.wash-sale-row {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}
.wash-sale-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}
.wash-sale-ticker {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
}
.wash-sale-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wash-sale-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.badge-warn { background: #fef3c7; color: #92400e; }
.wash-sale-refresh {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 14px 16px;
}
.refresh-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.refresh-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.refresh-row input[type="date"] { flex: 1; min-width: 140px; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  background: var(--white);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-copy { font-size: 0.85rem; color: var(--text-muted); }

/* ── Nav user area ────────────────────────────────────────────────────────── */
.nav-spacer { flex: 1; }
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-user-email {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-sm { font-size: 0.85rem; padding: 7px 16px; }

/* ── Auth tabs ────────────────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--purple-soft);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 28px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-tab.is-active {
  background: var(--white);
  color: var(--purple);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .hero { padding: 64px 20px 60px; }
  .card { padding: 24px 20px; }
  .field-row { grid-template-columns: 1fr; }
  .field-row.no-wrap { flex-direction: column; align-items: stretch; }
}
