:root {
  --ink: #18332d;
  --muted: #6e7f7a;
  --forest: #163a33;
  --forest-light: #285d51;
  --mint: #dcebe6;
  --cream: #f5f1e9;
  --paper: #fffdf9;
  --line: #dbe3df;
  --danger: #a84040;
  --shadow: 0 18px 50px rgba(22, 58, 51, .09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 12%, rgba(190, 216, 207, .4), transparent 28rem),
    radial-gradient(circle at 90% 5%, rgba(229, 212, 178, .35), transparent 26rem),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: var(--forest-light); font-weight: 700; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: auto;
  padding: 0 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--forest);
  font-size: 1.08rem;
  text-decoration: none;
  letter-spacing: -.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: white;
  background: var(--forest);
  border-radius: 50% 50% 50% 12px;
  font-family: Georgia, serif;
}

.link-button, .danger-link {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--forest-light);
  font-weight: 700;
}

.page-shell { max-width: 1180px; min-height: calc(100vh - 145px); margin: auto; padding: 42px 28px 70px; }
footer { padding: 20px; color: var(--muted); text-align: center; font-size: .85rem; }

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
h1 { max-width: 760px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.4rem, 5vw, 4.8rem); font-weight: 500; }
h2 { margin-bottom: 8px; font-size: 1.5rem; }
h3 { margin-bottom: 7px; }

.eyebrow {
  margin-bottom: 12px;
  color: var(--forest-light);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }
.card { border: 1px solid rgba(22, 58, 51, .09); border-radius: 24px; background: rgba(255, 253, 249, .94); box-shadow: var(--shadow); }

.auth-layout { display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: clamp(45px, 8vw, 120px); min-height: 610px; }
.intro-panel > p:not(.eyebrow) { max-width: 550px; color: var(--muted); font-size: 1.14rem; }
.auth-card { padding: clamp(28px, 5vw, 48px); }
.auth-card h2 { margin-bottom: 28px; font-size: 2rem; }

.steps { display: flex; flex-wrap: wrap; gap: 16px 26px; margin-top: 38px; color: var(--muted); font-size: .9rem; }
.steps span { display: flex; align-items: center; gap: 8px; }
.steps b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--mint); color: var(--forest); }
.privacy-note { display: inline-flex; align-items: center; gap: 10px; margin-top: 25px; padding: 12px 16px; border-radius: 12px; background: rgba(220, 235, 230, .72); color: var(--forest); font-size: .9rem; }

.form-stack { display: grid; gap: 19px; }
label { display: grid; gap: 8px; color: var(--ink); font-size: .88rem; font-weight: 750; }
input, select {
  width: 100%;
  min-height: 49px;
  padding: 12px 14px;
  border: 1px solid #cbd7d2;
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: white;
}
input:focus, select:focus { border-color: var(--forest-light); box-shadow: 0 0 0 3px rgba(40, 93, 81, .12); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.optional { color: var(--muted); font-size: .75rem; font-weight: 500; }
.custom-reminder-field[hidden] { display: none; }

.primary-button {
  min-height: 51px;
  padding: 12px 20px;
  border: 0;
  border-radius: 11px;
  color: white;
  background: var(--forest);
  font-weight: 800;
  box-shadow: 0 9px 18px rgba(22, 58, 51, .15);
  transition: transform .15s ease, background .15s ease;
}
.primary-button:hover { transform: translateY(-1px); background: var(--forest-light); }
.auth-switch { margin: 25px 0 0; color: var(--muted); text-align: center; font-size: .9rem; }

.flash-stack { display: grid; gap: 10px; margin: 0 0 24px; }
.flash { padding: 14px 17px; border-radius: 12px; font-size: .92rem; }
.flash-success { background: #dcebe2; color: #18482f; }
.flash-error { background: #f4dddd; color: #7d2929; }

.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 35px; margin-bottom: 32px; }
.dashboard-heading h1 { margin-bottom: 8px; font-size: clamp(2.3rem, 4vw, 4rem); }
.dashboard-heading p:last-child { margin-bottom: 0; }
.status-pill { flex: none; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid #c6d8d1; border-radius: 999px; background: rgba(255,255,255,.55); color: var(--forest); font-size: .82rem; font-weight: 700; }
.status-pill span { width: 7px; height: 7px; border-radius: 50%; background: #42a476; box-shadow: 0 0 0 4px rgba(66,164,118,.13); }
.notice { margin-bottom: 24px; padding: 16px 18px; border: 1px solid #decf9c; border-radius: 14px; background: #fff8dc; color: #685820; font-size: .9rem; }

.dashboard-grid { display: grid; grid-template-columns: minmax(290px, .8fr) minmax(420px, 1.2fr); align-items: start; gap: 30px; }
.record-card { position: sticky; top: 24px; padding: 27px; }
.card-heading { display: flex; gap: 14px; margin-bottom: 25px; }
.card-heading p { margin: 0; color: var(--muted); font-size: .88rem; }
.icon-box { display: grid; flex: none; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--mint); color: var(--forest); font-size: 1.35rem; }
.reminder-preview { display: flex; gap: 11px; padding: 13px; border-radius: 11px; background: #f0f6f3; color: var(--muted); font-size: .82rem; }
.reminder-preview p { margin: 0; }
.reminder-preview span { color: var(--forest-light); }

.history-heading { display: flex; align-items: end; justify-content: space-between; margin: 7px 0 22px; }
.history-heading h2 { margin: 0; }
.history-heading .eyebrow { margin-bottom: 6px; }
.count-badge { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.7); color: var(--muted); font-size: .77rem; font-weight: 700; }
.timeline { position: relative; display: grid; gap: 14px; }
.timeline::before { content: ""; position: absolute; top: 20px; bottom: 20px; left: 6px; width: 1px; background: #baccc5; }
.timeline-item { position: relative; padding-left: 28px; }
.timeline-dot { position: absolute; z-index: 1; top: 27px; left: 1px; width: 11px; height: 11px; border: 3px solid var(--cream); border-radius: 50%; background: var(--forest-light); box-shadow: 0 0 0 1px #87a99d; }
.timeline-card { padding: 22px; border: 1px solid rgba(22,58,51,.09); border-radius: 17px; background: rgba(255,253,249,.84); transition: background .15s ease, transform .15s ease; }
.timeline-card:hover { transform: translateX(2px); background: var(--paper); }
.timeline-main, .timeline-footer { display: flex; justify-content: space-between; gap: 18px; }
.timeline-main p, .timeline-footer p { margin: 0; color: var(--muted); font-size: .82rem; }
.timeline-footer { align-items: center; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.state { flex: none; height: fit-content; padding: 5px 9px; border-radius: 999px; font-size: .7rem; font-weight: 800; }
.state-waiting { background: #eee7d7; color: #765d26; }
.state-sent { background: #d9ece3; color: #276047; }
.state-none { background: #e5e8e7; color: #59635f; }
.danger-link { color: var(--danger); font-size: .8rem; }
.empty-state { padding: 70px 30px; border: 1px dashed #b9c8c3; border-radius: 20px; color: var(--muted); text-align: center; }
.empty-state span { display: block; margin-bottom: 14px; color: #809e94; font-size: 2rem; }
.empty-state h3 { color: var(--ink); }
.empty-state p { margin-bottom: 0; font-size: .9rem; }

@media (max-width: 800px) {
  .page-shell { padding-top: 25px; }
  .auth-layout, .dashboard-grid { grid-template-columns: 1fr; }
  .auth-layout { min-height: auto; gap: 35px; }
  .intro-panel h1 { font-size: 2.8rem; }
  .record-card { position: static; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .site-header { height: 66px; padding: 0 18px; }
  .page-shell { padding: 22px 18px 50px; }
  .auth-card, .record-card { padding: 22px; border-radius: 19px; }
  .steps { display: grid; }
  .timeline-main { align-items: flex-start; }
  .timeline-footer { align-items: flex-start; flex-direction: column; }
}
