/* =========================================================
   TurnBackClock Memory Companion — Stylesheet
   Design goals: large text, high contrast, calm and trustworthy,
   no clutter, no unnecessary animation.
   ========================================================= */

:root {
  --tbc-teal: #43A047;
  --tbc-teal-dark: #2E7D32;
  --tbc-cream: #F8F9FA;
  --tbc-ink: #1F2937;
  --tbc-muted: #6B7280;
  --tbc-border: #E5E7EB;
  --tbc-success: #2E7D32;
  --tbc-danger: #DC2626;
  --tbc-radius: 16px;

  --tbc-green-light: #E8F5E9;
  --tbc-blue: #1E88E5;
  --tbc-blue-dark: #1565C0;
  --tbc-blue-light: #E3F2FD;
  --tbc-purple: #8E24AA;
  --tbc-purple-dark: #7B1FA2;
  --tbc-purple-light: #F3E5F5;
  --tbc-orange: #FB8C00;
  --tbc-orange-dark: #EF6C00;
  --tbc-orange-light: #FFF3E0;
  --tbc-yellow: #FFB300;
  --tbc-yellow-light: #FFF8E1;
}

body {
  background-color: var(--tbc-cream);
  color: var(--tbc-ink);
  font-family: "Segoe UI", Verdana, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }

a { color: var(--tbc-teal-dark); }

.https-warning {
  background: #fff3cd;
  color: #664d03;
  font-size: 0.95rem;
}

/* Navigation */
.app-navbar {
  background: var(--tbc-teal);
  padding: 0.75rem 0;
}
.app-navbar .navbar-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.35rem;
}
.app-navbar .brand-sub {
  font-weight: 400;
  font-size: 1rem;
  opacity: 0.9;
}
.app-navbar .nav-link {
  color: #eaf3f1;
  font-size: 1.1rem;
  padding: 0.5rem 0.85rem;
}
.app-navbar .nav-link:hover { color: #fff; text-decoration: underline; }

.app-main { padding-top: 2rem; padding-bottom: 3rem; min-height: 60vh; }

/* Flash messages */
.flash-message { font-size: 1.1rem; border-radius: var(--tbc-radius); }

/* Big primary action buttons on the dashboard */
.btn-tbc-primary {
  display: block;
  width: 100%;
  padding: 1.5rem 1rem;
  font-size: 1.35rem;
  font-weight: 600;
  border-radius: var(--tbc-radius);
  background: var(--tbc-teal);
  color: #fff;
  border: none;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.btn-tbc-primary:hover { background: var(--tbc-teal-dark); color: #fff; }
.btn-tbc-primary i { font-size: 1.8rem; display: block; margin-bottom: 0.4rem; }

.btn-tbc-secondary {
  display: inline-block;
  padding: 0.9rem 1.4rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--tbc-radius);
  background: #fff;
  color: var(--tbc-teal-dark);
  border: 2px solid var(--tbc-teal);
  text-decoration: none;
}
.btn-tbc-secondary:hover { background: #eef6f5; color: var(--tbc-teal-dark); }

.btn-tbc-danger {
  background: var(--tbc-danger);
  color: #fff;
  border: none;
}
.btn-tbc-danger:hover { background: #8f1d17; color: #fff; }

/* Forms */
.form-label { font-size: 1.1rem; font-weight: 600; }
.form-control, .form-select {
  font-size: 1.15rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 2px solid var(--tbc-border);
}
.form-control:focus, .form-select:focus {
  border-color: var(--tbc-teal);
  box-shadow: 0 0 0 0.2rem rgba(44, 95, 95, 0.2);
}

/* Password show/hide toggle */
.password-field { position: relative; }
.password-field .form-control { padding-right: 3.2rem; }
.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--tbc-muted);
  font-size: 1.3rem;
}
.password-toggle:hover, .password-toggle:focus { color: var(--tbc-teal-dark); }

.sensitive-warning {
  background: #fff8e6;
  border: 1px solid #f0d585;
  border-radius: var(--tbc-radius);
  padding: 0.9rem 1.1rem;
  font-size: 1rem;
  color: #6b5300;
}

/* Memory cards */
.memory-card {
  background: #fff;
  border: 1px solid var(--tbc-border);
  border-radius: var(--tbc-radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.memory-card .category-icon {
  font-size: 1.6rem;
  color: var(--tbc-teal);
  margin-right: 0.5rem;
}
.memory-card .memory-title {
  font-size: 1.35rem;
  font-weight: 700;
}
.memory-card .memory-meta {
  color: var(--tbc-muted);
  font-size: 1.05rem;
}
.memory-card .memory-notes-preview {
  margin-top: 0.5rem;
  color: var(--tbc-ink);
}

/* Reminder groups */
.reminder-group-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--tbc-teal-dark);
}

/* Longevity CTA */
.longevity-cta {
  background: #eef6f5;
  border: 1px solid var(--tbc-border);
  border-radius: var(--tbc-radius);
  padding: 1.75rem;
  text-align: center;
  margin-top: 2.5rem;
}
.longevity-cta h3 { margin-bottom: 0.5rem; }

/* Footer */
.app-footer {
  background: #eef2f0;
  color: var(--tbc-muted);
  font-size: 1rem;
}

/* Admin tables (denser than the rest of the app, since this is an
   internal admin tool, not the senior-facing part of the site) */
.admin-table {
  font-size: 1rem;
  background: #fff;
}
.admin-table th {
  color: var(--tbc-muted);
  font-weight: 600;
  border-bottom: 2px solid var(--tbc-border);
}

/* Search box */
.search-box {
  font-size: 1.3rem;
  padding: 1rem 1.25rem;
  border-radius: var(--tbc-radius);
}

/* =========================================================
   Landing page (homepage) sections
   ========================================================= */

.hero-landing {
  padding: 2.5rem 0 3.5rem;
}
.hero-eyebrow {
  color: var(--tbc-teal-dark);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
.hero-title {
  font-size: 2.6rem;
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 1.1rem;
  color: var(--tbc-ink);
}
.hero-subtitle {
  font-size: 1.3rem;
  color: var(--tbc-muted);
  margin-bottom: 1.75rem;
}
.hero-reassurance {
  color: var(--tbc-muted);
  font-size: 1.05rem;
}
.hero-reassurance i { color: var(--tbc-success); margin-right: 0.3rem; }
.hero-illustration {
  width: 100%;
  max-width: 420px;
  height: auto;
}

.section-title {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--tbc-ink);
}
.section-subtitle {
  color: var(--tbc-muted);
  font-size: 1.15rem;
}

/* Benefits grid */
.benefits-section { padding: 3rem 0; }
.benefit-card {
  background: #fff;
  border: 1px solid var(--tbc-border);
  border-radius: var(--tbc-radius);
  padding: 1.75rem 1.5rem;
  height: 100%;
}
.benefit-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--tbc-teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.benefit-card h3 { margin-bottom: 0.5rem; }
.benefit-card p { margin-bottom: 0; color: var(--tbc-muted); }

/* How it works */
.how-it-works { padding: 3rem 0; }
.step-card {
  background: var(--tbc-cream);
  border-radius: var(--tbc-radius);
  padding: 1.75rem 1.5rem;
  height: 100%;
  text-align: center;
}
.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--tbc-teal-dark);
  color: #fff;
  font-weight: 700;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.step-card h3 { margin-bottom: 0.5rem; }
.step-card p { color: var(--tbc-muted); margin-bottom: 0; }

/* Trust strip */
.trust-strip {
  background: #fff;
  border-top: 1px solid var(--tbc-border);
  border-bottom: 1px solid var(--tbc-border);
  padding: 2.5rem 0;
  margin: 1rem 0 3rem;
}
.trust-strip i {
  font-size: 1.8rem;
  color: var(--tbc-teal);
  display: block;
  margin-bottom: 0.5rem;
}
.trust-strip p {
  margin-bottom: 0;
  font-weight: 600;
  color: var(--tbc-ink);
}

@media (max-width: 767px) {
  .hero-title { font-size: 2.1rem; }
  .hero-subtitle { font-size: 1.15rem; }
}

@media (max-width: 576px) {
  body { font-size: 19px; }
  .btn-tbc-primary { font-size: 1.2rem; padding: 1.25rem 1rem; }
}

/* =========================================================
   App shell: sidebar navigation + topbar (logged-in pages)
   ========================================================= */

.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--tbc-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
  padding: 0 0.4rem;
  text-decoration: none;
}
.sidebar-logo .brand-name {
  font-weight: 800;
  font-size: 1rem;
  color: var(--tbc-ink);
  line-height: 1.15;
}
.sidebar-logo .brand-sub {
  font-size: 0.8rem;
  color: var(--tbc-teal-dark);
  font-weight: 700;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
}
.sidebar-nav li { margin-bottom: 0.2rem; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  color: #4B5563;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
}
.sidebar-nav a:hover { background: #F3F4F6; color: var(--tbc-ink); }
.sidebar-nav a.active { background: var(--tbc-green-light); color: var(--tbc-teal-dark); }
.sidebar-nav a i:first-child { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-ext-icon { font-size: 0.75rem !important; margin-left: auto; opacity: 0.6; }

.sidebar-divider { border: none; border-top: 1px solid var(--tbc-border); margin: 0.75rem 0; }

.sidebar-footer-card {
  margin-top: auto;
  background: var(--tbc-green-light);
  border-radius: var(--tbc-radius);
  padding: 1.1rem;
  font-size: 0.9rem;
  color: var(--tbc-ink);
}
.sidebar-footer-card i {
  color: var(--tbc-teal-dark);
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
  display: block;
}
.sidebar-footer-card p { color: var(--tbc-muted); }

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 2rem;
  border-bottom: 1px solid var(--tbc-border);
  background: #fff;
  flex-wrap: wrap;
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.topbar-greeting h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.topbar-sun { color: #FFB300; font-size: 1.3rem; }
.topbar-greeting p { color: var(--tbc-muted); margin-bottom: 0; font-size: 0.95rem; }

.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.btn-help {
  border: 2px solid var(--tbc-border);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  background: #fff;
  color: var(--tbc-ink);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
}
.btn-help:hover { background: #F9FAFB; color: var(--tbc-ink); }

.profile-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--tbc-border);
  border-radius: 10px;
  padding: 0.35rem 0.85rem 0.35rem 0.35rem;
  background: #fff;
}
.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tbc-green-light);
  color: var(--tbc-teal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.profile-name { font-weight: 600; color: var(--tbc-ink); font-size: 0.95rem; }

.content { padding: 1.75rem 2rem 2.5rem; flex: 1; }

.mobile-menu-btn {
  display: none;
  border: 2px solid var(--tbc-border);
  border-radius: 10px;
  background: #fff;
  padding: 0.45rem 0.65rem;
  font-size: 1.2rem;
  color: var(--tbc-ink);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 22, 0.4);
  z-index: 1040;
}
.sidebar-overlay.show { display: block; }

.app-footer-shell {
  border-top: 1px solid var(--tbc-border);
  padding: 1.5rem 2rem;
  color: var(--tbc-muted);
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    z-index: 1050;
    box-shadow: 0 0 28px rgba(0,0,0,0.18);
    transition: left 0.2s ease;
  }
  .sidebar.open { left: 0; }
  .mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .topbar { padding: 1rem 1.25rem; }
  .content { padding: 1.25rem 1.25rem 2rem; }
}

/* =========================================================
   Dashboard: stat cards, quick access, reminders panel, tips
   ========================================================= */

.stat-card {
  background: #fff;
  border: 1px solid var(--tbc-border);
  border-radius: var(--tbc-radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.stat-card-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.green { background: var(--tbc-green-light); color: var(--tbc-teal-dark); }
.stat-icon.orange { background: var(--tbc-orange-light); color: var(--tbc-orange-dark); }
.stat-icon.blue { background: var(--tbc-blue-light); color: var(--tbc-blue-dark); }
.stat-icon.purple { background: var(--tbc-purple-light); color: var(--tbc-purple-dark); }

.stat-number { font-size: 1.8rem; font-weight: 800; color: var(--tbc-ink); line-height: 1.1; }
.stat-label { color: var(--tbc-muted); font-size: 0.92rem; }
.stat-card-footer { margin-top: auto; padding-top: 0.8rem; border-top: 1px solid var(--tbc-border); }
.stat-card-footer a {
  color: var(--tbc-ink);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-progress { height: 6px; border-radius: 3px; background: var(--tbc-purple-light); overflow: hidden; margin-top: 0.5rem; }
.stat-progress-bar { height: 100%; background: var(--tbc-purple-dark); border-radius: 3px; }

.qa-card {
  border-radius: var(--tbc-radius);
  padding: 1.4rem;
  height: 100%;
  text-decoration: none;
  display: block;
  border: 1px solid;
}
.qa-card.green { background: #F1F8F2; border-color: #C8E6C9; }
.qa-card.blue { background: #EFF6FD; border-color: #BBDEFB; }
.qa-card.purple { background: #F8F1FA; border-color: #E1BEE7; }
.qa-card.orange { background: #FFF7ED; border-color: #FFE0B2; }

.qa-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: 0.85rem;
}
.qa-icon.green { background: var(--tbc-teal); }
.qa-icon.blue { background: var(--tbc-blue); }
.qa-icon.purple { background: var(--tbc-purple); }
.qa-icon.orange { background: var(--tbc-orange); }

.qa-card h3 {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}
.qa-card.green h3 { color: var(--tbc-teal-dark); }
.qa-card.blue h3 { color: var(--tbc-blue-dark); }
.qa-card.purple h3 { color: var(--tbc-purple-dark); }
.qa-card.orange h3 { color: var(--tbc-orange-dark); }
.qa-card p { color: #4B5563; font-size: 0.92rem; margin-bottom: 0.7rem; }
.qa-arrow { font-weight: 700; }
.qa-card.green .qa-arrow { color: var(--tbc-teal-dark); }
.qa-card.blue .qa-arrow { color: var(--tbc-blue-dark); }
.qa-card.purple .qa-arrow { color: var(--tbc-purple-dark); }
.qa-card.orange .qa-arrow { color: var(--tbc-orange-dark); }

.side-panel {
  background: #fff;
  border: 1px solid var(--tbc-border);
  border-radius: var(--tbc-radius);
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}
.side-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.side-panel-header h2 { font-size: 1.1rem; font-weight: 800; margin: 0; }
.side-panel-header a { font-size: 0.88rem; color: var(--tbc-blue-dark); text-decoration: none; font-weight: 700; }

.reminder-group-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--tbc-muted);
  text-transform: uppercase;
  margin: 1rem 0 0.4rem;
}
.reminder-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--tbc-border);
  text-decoration: none;
  color: inherit;
}
.reminder-row:last-child { border-bottom: none; }
.reminder-time { font-size: 0.82rem; font-weight: 800; color: var(--tbc-teal-dark); min-width: 58px; flex-shrink: 0; }
.reminder-row .reminder-info { flex: 1; min-width: 0; }
.reminder-row .reminder-title {
  font-weight: 700;
  color: var(--tbc-ink);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reminder-row .reminder-sub { color: var(--tbc-muted); font-size: 0.83rem; }
.reminder-row .chevron { color: #9CA3AF; flex-shrink: 0; }
.reminder-empty { color: var(--tbc-muted); font-size: 0.9rem; padding: 0.5rem 0; }

.tip-card {
  background: var(--tbc-yellow-light);
  border-radius: var(--tbc-radius);
  padding: 1.4rem;
  text-align: center;
}
.tip-card .tip-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--tbc-yellow);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin: 0 auto 0.75rem;
}
.tip-card h3 { font-weight: 800; margin-bottom: 0.5rem; font-size: 1.05rem; }
.tip-card p { color: #6B5900; font-size: 0.92rem; }
.tip-card .tip-highlight { font-style: italic; font-weight: 700; color: #8A6D00; }

.longevity-banner {
  background: linear-gradient(120deg, #EAF7EC, #F3FBF0);
  border-radius: 20px;
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
}
.longevity-banner img { width: 200px; max-width: 100%; flex-shrink: 0; }
.longevity-banner-text h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.4rem; }
.longevity-banner-text p { color: #4B5563; margin-bottom: 1rem; }
.longevity-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  width: auto;
  max-width: none;
}

@media (max-width: 575px) {
  .longevity-banner { justify-content: center; text-align: center; }
}
