*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand palette */
  --navy: #16213e;
  --navy-deep: #1a1a2e;
  --gold: #c9973a;
  --gold-light: #e2b96f;
  --gold-pale: #fdf0d5;
  --cream: #fdf6ec;
  --cream-dark: #f5ead8;

  /* Aliases used throughout */
  --blue: var(--navy);
  --blue-light: var(--gold-light);
  --blue-pale: var(--gold-pale);
  --blue-dark: var(--navy-deep);
  --green: #2d7a4f;
  --red: #b91c1c;
  --gray-50: #f9f7f3;
  --gray-100: #f0ece4;
  --gray-200: #e0d9cc;
  --gray-400: #9c917e;
  --gray-600: #5c5041;
  --gray-800: #2a2117;
  --radius: 10px;
  --shadow: 0 2px 16px rgba(22,33,62,.10);
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--gray-800);
  background: var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
  text-decoration: none;
}
.btn-primary { background: var(--gold); color: #fff !important; }
.btn-primary:hover { background: #a67c28; text-decoration: none; color: #fff !important; }
.btn-outline { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--gold-pale); text-decoration: none; }
.hero .btn-outline { border-color: rgba(255,255,255,.7); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,.15); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--gray-600); border-color: var(--gray-200); }
.btn-ghost:hover { background: var(--gray-100); text-decoration: none; }
.btn-white { background: #fff; color: var(--navy); }
.btn-white:hover { background: var(--gold-pale); text-decoration: none; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ── Navbar ── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 64px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-light);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo { font-size: 20px; }
.nav-links { display: flex; align-items: center; gap: 24px; font-size: 14px; font-weight: 500; }
.nav-links a { color: rgba(255,255,255,.75); text-decoration: none; }
.nav-links a:hover { color: var(--gold-light); }
.nav-links .btn-primary { color: #fff !important; }
.nav-links .btn-primary:hover { color: #fff !important; }
.nav-links .btn-outline { border-color: rgba(255,255,255,.5); color: #fff; }
.nav-links .btn-outline:hover { background: rgba(255,255,255,.1); }
.nav-links .btn { font-size: 14px; padding: 7px 16px; }

/* ── Flash ── */
.flash-container { padding: 0 40px; margin-top: 16px; }
.flash { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 8px; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: var(--gold-pale); color: var(--navy); }

/* ── Container ── */
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* ── Hero ── */
.hero {
  background: linear-gradient(150deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #fff;
  padding: 80px 40px;
  text-align: center;
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .65; margin-bottom: 16px; color: var(--gold-light); }
.hero h1 { font-size: 48px; font-weight: 700; line-height: 1.15; margin-bottom: 20px; }
.hero-accent { color: var(--gold-light); }
.hero-sub { font-size: 18px; opacity: .85; margin-bottom: 32px; line-height: 1.6; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Tools Section ── */
.tools-section { padding: 72px 0; }
.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.tool-card {
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tool-icon { font-size: 36px; }
.tool-card h2 { font-size: 22px; font-weight: 700; }
.tool-card p { color: var(--gray-600); line-height: 1.6; }
.tool-features { list-style: none; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tool-features li { font-size: 14px; color: var(--gray-600); padding-left: 20px; position: relative; }
.tool-features li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }

/* ── CTA Section ── */
.cta-section { padding: 0 0 72px; }
.cta-box {
  background: linear-gradient(150deg, var(--navy-deep), var(--navy));
  border-radius: 20px;
  padding: 60px 40px;
  text-align: center;
  color: #fff;
}
.cta-box h2 { font-size: 30px; font-weight: 700; margin-bottom: 12px; }
.cta-box p { font-size: 16px; opacity: .85; margin-bottom: 28px; }

/* ── Page Header ── */
.page-header { background: var(--cream-dark); border-bottom: 1px solid var(--gray-200); padding: 40px 0; }
.page-header h1 { font-size: 32px; font-weight: 700; margin-bottom: 6px; }
.page-header p { color: var(--gray-600); font-size: 16px; }
.page-body { padding: 40px 24px; }

/* ── Plan tabs ── */
.plan-type-tabs { display: flex; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.tab-btn {
  padding: 9px 20px;
  border-radius: 999px;
  border: 2px solid var(--gray-200);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-600);
  transition: all .15s;
}
.tab-btn.active, .tab-btn:hover { border-color: var(--gold); color: var(--navy); background: var(--gold-pale); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.form-group label { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.form-group input, .form-group select, .form-group textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--gray-800);
  background: #fff;
  transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: #fffdf8;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-hint { font-size: 12px; color: var(--gray-400); }
.plan-desc { color: var(--gray-600); margin-bottom: 20px; line-height: 1.6; }

/* ── Input prefix ── */
.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-weight: 600;
  pointer-events: none;
}
.input-prefix-wrap input { padding-left: 28px; }

/* ── Range ── */
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] { flex: 1; accent-color: var(--gold); }
.pct-display { font-size: 18px; font-weight: 700; color: var(--navy); min-width: 44px; }

/* ── Annualized row ── */
.tithe-annualized {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 13px;
}
.annualized-label { color: var(--gray-600); font-weight: 600; white-space: nowrap; }
.annualized-value { color: var(--gold); font-weight: 600; }

/* ── Duration row ── */
.duration-row { display: flex; gap: 8px; align-items: center; }
.duration-input { width: 80px !important; }

/* ── Book checkbox grid ── */
.book-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}
.checkbox-label input { accent-color: var(--gold); }

/* ── Tithe Result ── */
.tithe-result {
  background: var(--gold-pale);
  border: 2px solid var(--gold-light);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  margin-bottom: 32px;
}
.result-label { font-size: 13px; font-weight: 600; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.result-amount { font-size: 48px; font-weight: 700; color: var(--navy); line-height: 1; margin-bottom: 8px; }
.result-sub { font-size: 14px; color: var(--gray-600); }

/* ── Tithe layout ── */
.tithe-layout { display: grid; grid-template-columns: 1fr 340px; gap: 48px; align-items: start; }
.tithe-calc-card { background: #fff; }
.tithe-info { background: var(--gray-50); border-radius: 16px; padding: 28px; }
.tithe-info h3 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.tithe-info p { font-size: 14px; color: var(--gray-600); line-height: 1.7; }
.tithe-info hr { border: none; border-top: 1px solid var(--gray-200); margin: 20px 0; }
.tithe-info h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.tithe-info details { margin-bottom: 10px; }
.tithe-info summary { font-size: 14px; font-weight: 600; cursor: pointer; color: var(--navy); margin-bottom: 6px; }
.tithe-info details p { font-size: 13px; padding-left: 12px; border-left: 2px solid var(--gray-200); }

/* ── Log section ── */
.log-section { border-top: 1px solid var(--gray-200); padding-top: 24px; }
.log-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.log-cta { background: var(--gray-50); border-radius: var(--radius); padding: 24px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.log-cta p { font-size: 14px; color: var(--gray-600); }
.label-hint { font-weight: 400; color: var(--gray-400); font-size: 13px; }

/* ── Estimated time callout ── */
.est-callout {
  display: none;
  background: var(--gold-pale);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 15px;
  font-style: italic;
  color: var(--navy);
  line-height: 1.5;
}
.est-callout.visible { display: block; }

/* ── Shared options panel ── */
.shared-options {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 24px;
  margin-top: 20px;
  margin-bottom: 28px;
}
.shared-options > .form-group { margin-bottom: 20px; }
.shared-options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}
.shared-options .shared-options-grid .form-group { margin-bottom: 0; }

/* ── Progress bar (plan view) ── */
.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.progress-bar-track {
  flex: 1;
  height: 10px;
  background: var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
  transition: width .3s ease;
}
.progress-label { font-size: 13px; font-weight: 600; color: var(--gray-600); white-space: nowrap; }

/* ── Mini progress (my plans cards) ── */
.mini-progress-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.mini-progress-track { flex: 1; height: 6px; background: var(--gray-200); border-radius: 999px; overflow: hidden; }
.mini-progress-fill { height: 100%; background: var(--gold); border-radius: 999px; }
.mini-progress-label { font-size: 12px; font-weight: 600; color: var(--gray-400); white-space: nowrap; }

/* ── Completion checkboxes ── */
.col-check { width: 40px; text-align: center; }
.check-btn {
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 2px solid var(--gray-300);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.check-btn:hover { border-color: var(--gold); background: var(--gold-pale); color: var(--gold); }
.check-btn.checked { background: var(--gold); border-color: var(--gold); color: #fff; }
.day-done td { opacity: .55; text-decoration: line-through; }
.day-done .col-check td, .day-done .check-btn { opacity: 1; text-decoration: none; }
.day-date { color: var(--gray-600); font-size: 13px; white-space: nowrap; }

/* ── Plan table ── */
.plan-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--gray-200); }
.plan-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.plan-table th { background: var(--navy); color: #fff; padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600; }
.plan-table td { padding: 10px 16px; border-bottom: 1px solid var(--gray-100); }
.plan-table tr:last-child td { border-bottom: none; }
.plan-table tr:nth-child(even) td { background: var(--gray-50); }
.day-num { font-weight: 600; color: var(--navy); white-space: nowrap; }
.reading-ref { font-weight: 500; }

/* ── Preview actions ── */
.preview-actions { display: flex; gap: 10px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }

/* ── Saved cards ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.saved-card { border: 1px solid var(--gray-200); border-radius: 16px; padding: 24px; }
.saved-card-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); margin-bottom: 8px; }
.saved-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.saved-card-meta { font-size: 13px; color: var(--gray-400); margin-bottom: 16px; }
.saved-card-actions { display: flex; gap: 8px; }

/* ── Giving summary ── */
.giving-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.summary-stat { background: var(--gray-50); border-radius: var(--radius); padding: 20px; text-align: center; border: 1px solid var(--gray-200); }
.summary-label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-400); margin-bottom: 8px; }
.summary-value { display: block; font-size: 28px; font-weight: 700; color: var(--gray-800); }
.stat-good .summary-value { color: var(--green); }
.stat-behind .summary-value { color: var(--red); }
.text-good { color: var(--green); font-weight: 600; }
.text-behind { color: var(--red); font-weight: 600; }
.text-muted { color: var(--gray-400); font-size: 13px; }
.btn-delete { background: none; border: none; color: var(--gray-400); cursor: pointer; font-size: 14px; padding: 4px 8px; border-radius: 6px; }
.btn-delete:hover { background: #fee2e2; color: var(--red); }

/* ── Auth ── */
.auth-page { min-height: calc(100vh - 128px); display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 20px; padding: 48px 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.auth-sub { color: var(--gray-600); font-size: 14px; margin-bottom: 28px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--gray-600); margin-top: 20px; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 80px 24px; color: var(--gray-600); display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* ── Footer ── */
.footer { border-top: 1px solid var(--gray-200); padding: 24px 40px; text-align: center; font-size: 13px; color: var(--gray-400); }
.footer a { color: var(--gray-400); }
.footer-support { margin-bottom: 10px; }
.bmc-btn { display: inline-block; background: var(--gold); color: #fff !important; font-size: 13px; font-weight: 600; padding: 7px 18px; border-radius: 999px; text-decoration: none !important; transition: background .2s; }
.bmc-btn:hover { background: #a67c28; }

/* ── Verse of the Day ── */
.verse-section { background: var(--navy); padding: 40px 24px; }
.verse-of-day { max-width: 720px; margin: 0 auto; text-align: center; }
.verse-label { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin-bottom: 16px; }
.verse-text { font-size: 20px; font-style: italic; line-height: 1.6; color: #fff; margin-bottom: 10px; }
.verse-ref { font-size: 14px; font-weight: 600; color: var(--gold-light); display: block; margin-bottom: 18px; }
.verse-actions { display: flex; gap: 10px; justify-content: center; }
.btn-outline-gold { background: transparent; border: 1px solid var(--gold); color: var(--gold); padding: 6px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .2s, color .2s; }
.btn-outline-gold:hover { background: var(--gold); color: #fff; }
.share-wrap { position: relative; }
.share-menu { display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 180px; overflow: hidden; z-index: 100; }
.share-menu.open { display: block; }
.share-menu a, .share-menu button { display: block; width: 100%; padding: 11px 18px; font-size: 14px; font-weight: 500; color: var(--gray-800); text-decoration: none; background: none; border: none; text-align: left; cursor: pointer; transition: background .15s; }
.share-menu a:hover, .share-menu button:hover { background: var(--gold-pale); color: var(--navy); }

/* ── Version badge ── */
.version-badge { display: inline-block; background: var(--gold-pale); color: var(--navy); font-size: 11px; font-weight: 700; letter-spacing: .05em; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--gold-light); vertical-align: middle; }
a.reading-ref { color: var(--navy); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--gold-light); }
a.reading-ref:hover { color: var(--gold); border-color: var(--gold); }

/* ── Prayer Journal ── */
.prayer-add-box { background: #fff; border: 1px solid var(--gray-200); border-radius: 16px; padding: 28px; margin-bottom: 32px; box-shadow: var(--shadow); }
.prayer-add-box textarea { width: 100%; resize: vertical; }
.prayer-stats { display: flex; gap: 16px; margin-bottom: 32px; }
.prayer-stat { flex: 1; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 12px; padding: 16px; text-align: center; }
.stat-num { display: block; font-size: 32px; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-400); }
.prayer-section-title { font-size: 18px; font-weight: 700; color: var(--navy); margin-bottom: 16px; }
.answered-title { color: var(--green); }
.prayer-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 36px; }
.prayer-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; padding: 20px 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.prayer-card--answered { background: #f0fdf4; border-color: #bbf7d0; }
.prayer-card-body { flex: 1; }
.prayer-text { font-size: 15px; line-height: 1.6; color: var(--gray-800); margin-bottom: 6px; }
.prayer-date { font-size: 12px; color: var(--gray-400); }
.prayer-card-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.btn-answered { background: var(--gold-pale); color: var(--navy); border: 1px solid var(--gold-light); font-weight: 600; }
.btn-answered:hover { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-unanswer { background: #f0fdf4; color: var(--green); border: 1px solid #bbf7d0; font-weight: 600; }
.btn-unanswer:hover { background: #dcfce7; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; cursor: pointer; white-space: nowrap; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .nav-links { gap: 10px; font-size: 13px; }
  .hero { padding: 48px 20px; }
  .hero h1 { font-size: 30px; }
  .hero-sub { font-size: 15px; }
  .hero-cta { flex-direction: column; align-items: stretch; gap: 10px; }
  .tools-grid { grid-template-columns: 1fr; }
  .tithe-layout { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .giving-summary { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  /* Plan generator */
  .plan-type-tabs { gap: 6px; }
  .tab-btn { padding: 8px 14px; font-size: 13px; }
  .shared-options { padding: 16px; }
  .shared-options-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .shared-options > .form-group { margin-bottom: 14px; }
  /* Prayer */
  .prayer-stats { gap: 10px; }
  .prayer-card { flex-direction: column; gap: 12px; }
  .prayer-card-actions { flex-direction: row; }
  /* Verse */
  .verse-text { font-size: 17px; }
  /* Plan table */
  .plan-table { font-size: 13px; }
  .page-body { padding: 20px 16px; }
}

@media (max-width: 480px) {
  .shared-options-grid { grid-template-columns: 1fr; }
  .nav-links .btn-primary { padding: 7px 12px; font-size: 12px; }
}
