/* Karina's App — warm, articulate, green theme. Mobile-first & responsive. */
:root {
  --green-900: #0f3d28;
  --green-800: #14532d;
  --green-700: #1e7a4f;
  --green-600: #2fa36b;
  --green-500: #3cb878;
  --green-100: #eaf3ec;
  --green-50:  #f1f8f3;
  --ink:       #1b2e22;
  --muted:     #5d7766;
  --card:      #ffffff;
  --shadow:    0 10px 30px rgba(15, 61, 40, 0.12);
  --radius:    18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d8efe0 0%, rgba(216,239,224,0) 60%),
    radial-gradient(1000px 480px at 110% 0%, #cdeede 0%, rgba(205,238,222,0) 55%),
    var(--green-100);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-700); }

/* ---------- Layout ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 22px 16px 60px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .leaf { font-size: 26px; }
.brand h1 { font-size: 18px; margin: 0; color: var(--green-800); font-weight: 800; letter-spacing: .2px; }
.brand .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  border-radius: 12px; padding: 11px 18px; color: #fff;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  box-shadow: 0 6px 16px rgba(30, 122, 79, 0.28);
  transition: transform .06s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:hover { box-shadow: 0 8px 22px rgba(30, 122, 79, 0.34); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.secondary {
  background: #fff; color: var(--green-800);
  border: 1px solid #cfe6d7; box-shadow: none;
}
.btn.ghost { background: transparent; color: var(--green-800); box-shadow: none; padding: 8px 12px; }
.btn.fb { background: linear-gradient(135deg, #2b5bb0, #3b6fd6); box-shadow: 0 6px 16px rgba(43,91,176,.28); }
.btn.block { width: 100%; }
.btn.lg { padding: 14px 22px; font-size: 16px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Card ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card .hero { width: 100%; display: block; background: var(--green-50); }
.card .hero img { width: 100%; display: block; aspect-ratio: 3 / 2; object-fit: cover; }
.card .hero.placeholder {
  aspect-ratio: 3 / 2; display: flex; align-items: center; justify-content: center;
  color: var(--green-600); font-size: 44px;
  background: linear-gradient(135deg, #e7f5ec, #d4eede);
}
.card .body { padding: 22px 22px 24px; }

.stamp { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.pill { background: var(--green-50); color: var(--green-800); border: 1px solid #d7ebdf;
  border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700; letter-spacing: .03em; }

.label { font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--green-800); }
.affirmation { font-size: 21px; line-height: 1.5; margin: 8px 0 0; color: var(--ink); }
.aspiration { font-size: 16px; line-height: 1.6; margin: 8px 0 0; color: #33493c; }

.action {
  background: linear-gradient(135deg, #eafaf0, #dff5e8);
  border: 1px solid #bfe6cd; border-left: 4px solid var(--green-700);
  border-radius: 12px; padding: 14px 16px; margin-top: 18px;
}
.action .action-body { font-size: 16px; line-height: 1.55; color: var(--green-900); font-weight: 600; margin: 8px 0 0; }

.tip {
  background: var(--green-50); border-left: 4px solid var(--green-600);
  border-radius: 12px; padding: 14px 16px; margin-top: 18px;
}
.tip .tip-title { font-size: 16px; font-weight: 800; color: var(--green-900); margin-top: 6px; }
.tip .tip-body { font-size: 15px; line-height: 1.6; color: #33493c; margin: 6px 0 0; }

.section { margin-top: 20px; }
.divider { height: 1px; background: #e1efe6; margin: 18px 0; border: 0; }

.actions { margin-top: 20px; }

/* ---------- History ---------- */
.history-item {
  background: #fff; border: 1px solid #e1efe6; border-radius: 14px;
  padding: 14px 16px; margin-top: 12px; display: flex; gap: 14px; align-items: flex-start;
}
.history-item.current { border-color: var(--green-500); box-shadow: 0 0 0 2px rgba(60,184,120,.18); }
.history-thumb { width: 84px; height: 56px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; background: var(--green-50); }
.history-thumb.placeholder { display: flex; align-items: center; justify-content: center; color: var(--green-600); font-size: 22px; }
.history-main { flex: 1; min-width: 0; }
.history-main .ts { font-size: 12px; color: var(--muted); }
.history-main .txt { font-size: 14.5px; line-height: 1.45; margin: 4px 0 0; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.history-main .meta { margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Login ---------- */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { max-width: 420px; width: 100%; }
.login-card .body { padding: 28px 26px 30px; }
.login-card h2 { margin: 0 0 4px; color: var(--green-800); font-size: 22px; }
.login-card p.lede { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.field { margin-top: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--green-800); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 13px; border-radius: 11px; border: 1px solid #cfe6d7;
  font: inherit; color: var(--ink); background: #fbfefc;
}
.field input:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(60,184,120,.18); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.or::before, .or::after { content: ""; height: 1px; background: #dcebe1; flex: 1; }
#googleBtn { display: flex; justify-content: center; min-height: 0; }

/* ---------- Misc ---------- */
.note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.error { background: #fdeceb; color: #a4332b; border: 1px solid #f3c7c2;
  border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-top: 14px; display: none; }
.error.show { display: block; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px);
  background: var(--green-800); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 50; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hidden { display: none !important; }
.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff;
  border-radius: 50%; display: inline-block; vertical-align: -3px; margin-right: 8px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,61,40,.45); display: none;
  align-items: center; justify-content: center; padding: 20px; z-index: 60;
}
.modal-backdrop.show { display: flex; }
.modal { background: #fff; border-radius: 16px; max-width: 400px; width: 100%; box-shadow: var(--shadow); }
.modal .body { padding: 22px 22px 24px; }
.modal h3 { margin: 0 0 6px; color: var(--green-800); }

@media (min-width: 560px) {
  .affirmation { font-size: 23px; }
}
