/* Grant Finder — base styles. Light by default, dark follows the device.
   Green "growth/funding" accent (distinct from RiskKit/CareLedger/No-show). */
:root {
  --bg:#f5f8f6; --surface:#ffffff; --surface2:#eef3ef; --border:#dde6e0;
  --text:#16201a; --muted:#5c6b62; --accent:#1f9d57; --accent-soft:#e3f4ea;
  --ok:#1f9d57; --danger:#d63a31; --warn:#b87a00;
  --shadow:0 1px 2px rgba(0,0,0,.04),0 2px 8px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:#0e1511; --surface:#16201a; --surface2:#1e2a23; --border:#2a3830;
    --text:#e9f0ea; --muted:#9bab9f; --accent:#33c074; --accent-soft:#15301f; --shadow:none;
  }
}
* { box-sizing:border-box; }
body { margin:0; font-family:-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif; background:var(--bg); color:var(--text); font-size:14px; line-height:1.5; }
main { max-width:980px; margin:0 auto; padding:22px 20px 60px; }
h1 { font-size:22px; margin:0; letter-spacing:-0.4px; } h2 { font-size:15px; margin:0 0 10px; }
a { color:var(--accent); }
.page-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin:8px 0 18px; }
.page-head .sub { color:var(--muted); font-size:13px; margin-top:3px; }
.card { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:20px; margin-bottom:16px; box-shadow:var(--shadow); }
.field { margin-bottom:14px; }
.field label { display:block; font-size:12.5px; font-weight:600; color:var(--muted); margin-bottom:5px; }
input, select, textarea { width:100%; font-family:inherit; font-size:14px; color:var(--text); background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:9px 11px; }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--accent); }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width:640px){ .form-grid { grid-template-columns:1fr; } }
.btn { display:inline-flex; align-items:center; gap:7px; font-family:inherit; font-size:13.5px; font-weight:600; padding:9px 16px; border-radius:8px; border:1px solid var(--border); background:var(--surface); color:var(--text); cursor:pointer; text-decoration:none; }
.btn:hover { border-color:var(--accent); }
.btn-primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.btn-primary:hover { filter:brightness(1.06); }
.btn-sm { padding:5px 11px; font-size:12.5px; }
.btn:disabled { opacity:.55; cursor:default; }
.empty { text-align:center; color:var(--muted); padding:34px 16px; font-size:13.5px; }

/* Grant result cards */
.grant { border:1px solid var(--border); border-radius:12px; padding:18px; margin-bottom:12px; background:var(--surface); }
.grant .top { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.grant h3 { font-size:16px; margin:0 0 2px; }
.grant .funder { color:var(--muted); font-size:12.5px; }
.grant .fit { font-size:11px; font-weight:700; padding:3px 9px; border-radius:20px; white-space:nowrap; }
.grant .amount { font-weight:700; font-size:13px; margin:8px 0; }
.grant .why { font-size:13.5px; color:var(--text); margin:8px 0; }
.grant .why b { color:var(--accent); }
.grant .check { font-size:12.5px; color:var(--muted); margin:6px 0; }
.grant .row-actions { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.spinner { width:16px; height:16px; border:2px solid var(--border); border-top-color:var(--accent); border-radius:50%; animation:spin .7s linear infinite; display:inline-block; vertical-align:middle; }
@keyframes spin { to { transform:rotate(360deg); } }

.auth-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; }
.auth-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:34px; width:100%; max-width:420px; box-shadow:var(--shadow); }
.logo { display:flex; align-items:center; gap:11px; margin-bottom:6px; }
.logo .dot { width:38px; height:38px; border-radius:10px; background:var(--accent); display:grid; place-items:center; color:#fff; font-weight:800; font-size:13px; }
.logo-text { font-size:18px; font-weight:800; letter-spacing:-0.3px; } .logo-sub { font-size:12px; color:var(--muted); }
.lead { font-size:13.5px; color:var(--muted); margin:14px 0 20px; }
.msg { border-radius:8px; padding:10px 14px; font-size:13px; margin-bottom:14px; display:none; } .msg.show { display:block; }
.msg-error { background:rgba(214,58,49,.1); border:1px solid var(--danger); color:var(--danger); }
.msg-ok { background:rgba(31,157,87,.1); border:1px solid var(--ok); color:var(--ok); }
.foot { margin-top:16px; font-size:12px; color:var(--muted); text-align:center; line-height:1.6; } .foot a { font-weight:600; }
.disclaimer { background:var(--surface2); border:1px solid var(--border); border-radius:8px; padding:10px 14px; font-size:12.5px; color:var(--muted); margin-top:8px; }
#gf-toasts { position:fixed; bottom:18px; left:50%; transform:translateX(-50%); z-index:500; display:flex; flex-direction:column; gap:8px; }
.cl-toast { background:var(--text); color:var(--bg); padding:10px 16px; border-radius:8px; font-size:13px; font-weight:500; box-shadow:0 4px 14px rgba(0,0,0,.2); opacity:1; transition:opacity .35s; }
.cl-toast-ok { background:var(--ok); color:#fff; } .cl-toast-error { background:var(--danger); color:#fff; } .cl-toast.out { opacity:0; }
