/* Flower Garden - the "Soft" look from Movaq: pillowy raised cards on warm paper, inset fields,
   an orange glowing primary button. Over it, a zoomed-in flower garden for the sign-in and welcome screens. */
:root {
  --ink: #1d1a14; --mute: #6b6350; --brand: #e8590c; --brand-dark: #c2410c; --ok: #15803d; --bad: #c2261c; --warn: #b45309;
  --paper: #e8dbbd; --card: #ebdfc3; --line: rgba(90,70,30,.2); --soft: rgba(255,252,240,.5);
  --emb: 12px 12px 26px rgba(150,120,60,.38), -10px -10px 24px rgba(255,252,240,.85);
  --emb-sm: 5px 5px 11px rgba(150,120,60,.32), -4px -4px 10px rgba(255,252,240,.85);
  --emb-in: inset 5px 5px 11px rgba(150,120,60,.35), inset -5px -5px 11px rgba(255,252,240,.85);
  --emb-in-sm: inset 2px 2px 5px rgba(150,120,60,.35), inset -2px -2px 5px rgba(255,252,240,.85);
  --glow: 0 0 0 2px rgba(255,238,196,.8), 0 0 14px rgba(236,150,60,.34);
  --glow-brand: 0 0 0 3px rgba(255,170,100,.4), 0 0 20px rgba(242,122,58,.55);
  --sans: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Tamil", "Nirmala UI", sans-serif;
  --serif: Georgia, "Times New Roman", "Noto Serif Tamil", "Nirmala UI", serif;
  --paper-noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .12  0 0 0 .12 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --joy: repeating-linear-gradient(135deg, #ffd1e3 0 6px, #ffe9b0 6px 12px);   /* "still to go": cheerful, not heavy */
  --done: linear-gradient(180deg, #4cd68a, #15a35a);
}
* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: var(--sans); color: var(--ink); min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(1000px 700px at 20% 0%, #f4e9cf, transparent 60%), var(--paper-noise), var(--paper); }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.mute { color: var(--mute); } .small { font-size: .82rem; } .center { text-align: center; }
[hidden] { display: none !important; }

/* ---- garden background (sign-in + welcome only) ---- */
.garden { position: fixed; inset: 0; z-index: -1; opacity: 0; transition: opacity .5s; pointer-events: none;
  background: linear-gradient(rgba(20,40,20,.10), rgba(20,40,20,.26)), var(--garden-img, url(/img/garden.webp)) center / cover no-repeat, #2b5230; }
body.has-garden .garden { opacity: 1; }
body.has-garden { background: #2b5230; }

.app { width: 100%; max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
.boot { display: grid; place-items: center; height: 70vh; font-size: 3rem; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: .7; } }

/* ---- cards, fields, buttons ---- */
.card { background: var(--card); border-radius: 30px; box-shadow: var(--emb); padding: 20px; }
.auth { margin-top: 6vh; background: rgba(235,223,195,.93); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.4); }
.brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 4px; }
.brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: var(--emb-sm); }
.brand b { font-family: var(--serif); font-size: 1.55rem; letter-spacing: -.01em; }
.tagline { text-align: center; color: var(--mute); margin-bottom: 16px; font-size: .92rem; }
h2.title { font-family: var(--serif); font-size: 1.35rem; margin: 6px 0 4px; }

.steps { display: flex; justify-content: center; gap: 8px; margin: 2px 0 16px; }
.steps i { display: flex; align-items: center; gap: 6px; font-style: normal; font-size: .74rem; color: var(--mute); }
.steps i::before { content: attr(data-n); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: var(--emb-in-sm); font-weight: 700; }
.steps i.on { color: var(--brand-dark); font-weight: 700; } .steps i.on::before { background: var(--brand); color: #fff; box-shadow: var(--glow-brand); }
.steps i.done::before { content: '✓'; background: var(--ok); color: #fff; box-shadow: none; }
.steps i + i::after { content: ''; }

label { display: block; font-size: .8rem; color: var(--mute); margin: 12px 4px 5px; font-weight: 600; }
input, textarea, select { width: 100%; padding: 13px 16px; border: 0; border-radius: 18px; background: var(--card); box-shadow: var(--emb-in); outline: none; font-size: 1rem; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(232,89,12,.4); }
textarea { resize: vertical; min-height: 120px; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #a39a82; }
.code-in { text-align: center; font-size: 1.8rem; letter-spacing: .5em; font-weight: 700; padding-left: calc(16px + .5em); }
.pw-wrap { position: relative; } .pw-wrap input { padding-right: 96px; }
.pw-wrap .tiny { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.hint { font-size: .78rem; color: var(--mute); margin: 6px 6px 0; }
.err { color: var(--bad); font-size: .86rem; margin: 10px 4px 0; min-height: 1.1em; font-weight: 600; }
.shake { animation: shake .35s; } @keyframes shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; padding: 13px 22px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  background: linear-gradient(145deg, #f27a3a, #d9480f); color: #fff; box-shadow: 6px 6px 14px rgba(150,120,60,.4), -4px -4px 10px rgba(255,252,240,.85), var(--glow-brand); transition: box-shadow .2s, transform .1s; }
.btn:hover { box-shadow: 6px 6px 14px rgba(150,120,60,.4), -4px -4px 10px rgba(255,252,240,.85), 0 0 0 3px rgba(255,170,100,.5), 0 0 26px rgba(242,122,58,.7); }
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; margin-top: 18px; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 6px 6px 14px rgba(150,120,60,.35), -5px -5px 12px rgba(255,252,240,.85), var(--glow); }
.btn.danger { background: linear-gradient(145deg, #e0524a, #b3261e); }
.btn.sm { padding: 8px 16px; font-size: .88rem; }
/* every Save button: a lush, glowing green */
.btn.save { background: linear-gradient(145deg, #3fd37f, #12843f); box-shadow: 6px 6px 14px rgba(150,120,60,.4), -4px -4px 10px rgba(255,252,240,.85), 0 0 0 3px rgba(80,210,130,.4), 0 0 20px rgba(40,180,95,.55); text-shadow: 0 1px 2px rgba(0,60,20,.35); }
.btn.save:hover { box-shadow: 6px 6px 14px rgba(150,120,60,.4), -4px -4px 10px rgba(255,252,240,.85), 0 0 0 3px rgba(80,210,130,.5), 0 0 26px rgba(40,180,95,.75); }

/* deposits from connected apps */
.inbox-banner { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; cursor: pointer; margin-bottom: 14px; padding: 12px 16px; border-radius: 22px; background: var(--card); box-shadow: var(--emb-sm), 0 0 0 2px rgba(255,170,100,.45), 0 0 16px rgba(242,122,58,.35); font-size: .95rem; }
.inbox-banner small { display: block; color: var(--mute); font-size: .78rem; } .inbox-banner > span:first-child { font-size: 1.5rem; }
.dep { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.dep-btns { display: flex; gap: 6px; flex: none; } .tiny.save-t { background: linear-gradient(145deg, #3fd37f, #12843f); color: #fff; }
pre.code { background: var(--card); box-shadow: var(--emb-in-sm); border-radius: 14px; padding: 10px 12px; font-size: .72rem; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 8px 0; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; }

/* playful buttons: they drift right, left, up, then down, again and again */
@keyframes wander {
  0%, 100% { translate: 0 0; } 12% { translate: var(--wx) 0; } 25% { translate: 0 0; } 37% { translate: calc(var(--wx) * -1) 0; }
  50% { translate: 0 0; } 62% { translate: 0 calc(var(--wy) * -1); } 75% { translate: 0 0; } 87% { translate: 0 var(--wy); }
}
.wander { --wx: 18px; --wy: 9px; animation: wander 12s ease-in-out infinite; }
.wander:active { animation-play-state: paused; }
.btn:disabled { opacity: .6; cursor: default; } .btn.wait { opacity: .7; }
.tiny { border: 0; cursor: pointer; padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--card); color: var(--brand-dark); box-shadow: var(--emb-sm); }
.tiny:active { box-shadow: var(--emb-in-sm); }
.link { background: none; border: 0; color: var(--brand-dark); font-weight: 700; cursor: pointer; padding: 6px; text-decoration: underline; text-underline-offset: 3px; }
.sep { display: flex; align-items: center; gap: 10px; color: var(--mute); font-size: .8rem; margin: 16px 0 4px; }
.sep::before, .sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#gbtn { display: flex; justify-content: center; min-height: 44px; }
.row-btns { display: flex; gap: 10px; margin-top: 18px; } .row-btns .btn { flex: 1; }
.assure { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; font-size: .78rem; color: var(--mute); }
.meter { display: flex; gap: 5px; margin: 8px 4px 0; } .meter i { flex: 1; height: 6px; border-radius: 4px; background: var(--card); box-shadow: var(--emb-in-sm); }
.meter[data-s="1"] i:nth-child(-n+1) { background: var(--bad); } .meter[data-s="2"] i:nth-child(-n+2) { background: #e0a21b; } .meter[data-s="3"] i { background: var(--ok); }
.warn-box { background: rgba(255,252,240,.55); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: .84rem; margin-top: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 2px 0; font-size: .84rem; color: var(--ink); font-weight: 400; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; box-shadow: none; accent-color: var(--brand); }

/* ---- welcome ---- */
.welcome { min-height: calc(100dvh - 120px); display: grid; place-items: center; text-align: center; }
.plate { padding: 30px 34px 32px; border-radius: 34px; background: rgba(235,223,195,.62); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.45); box-shadow: 0 18px 50px rgba(20,40,20,.35); animation: rise .9s ease both; }
.plate .hello { font-family: var(--serif); font-size: 1.05rem; letter-spacing: .28em; text-transform: uppercase; color: var(--mute); }
.plate h1 { font-family: var(--serif); font-size: clamp(2.1rem, 9vw, 2.9rem); font-weight: 700; letter-spacing: -.01em; margin-top: 4px; word-break: break-word; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---- the one footer icon ---- */
.menu-fab { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: 58px; height: 58px; border-radius: 50%; z-index: 20; cursor: pointer;
  display: grid; place-items: center; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: rgba(255,255,255,.92); transition: background .2s, transform .1s; }
.menu-fab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.menu-fab:active { transform: translateX(-50%) scale(.92); }
body:not(.has-garden) .menu-fab { color: var(--ink); background: rgba(235,223,195,.55); border-color: rgba(90,70,30,.18); }

/* ---- bottom sheet ---- */
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(40,30,10,0); display: flex; align-items: flex-end; justify-content: center; transition: background .16s; }
.sheet-back.in { background: rgba(40,30,10,.4); } .sheet-back.out { background: rgba(40,30,10,0); }
.sheet { width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; background: var(--paper); background-image: var(--paper-noise); border-radius: 30px 30px 0 0; padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(60,40,10,.3); transform: translateY(100%); transition: transform .2s ease-out; }
.sheet-back.in .sheet { transform: none; } .sheet-back.out .sheet { transform: translateY(100%); }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: rgba(90,70,30,.25); margin: 4px auto 12px; }
.sheet h3 { font-family: var(--serif); font-size: 1.25rem; margin-bottom: 4px; }
.menu-list { display: grid; gap: 12px; margin-top: 14px; }
.menu-item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 0; cursor: pointer; padding: 14px 18px; border-radius: 22px; background: var(--card); box-shadow: var(--emb-sm); font-weight: 700; font-size: 1.02rem; }
.menu-item:active { box-shadow: var(--emb-in-sm); } .menu-item.on { box-shadow: var(--emb-in); color: var(--brand-dark); }
.menu-item svg, .ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.menu-item small { display: block; font-weight: 400; color: var(--mute); font-size: .78rem; }

/* ---- screens ---- */
.top { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; }
.top h2 { font-family: var(--serif); font-size: 1.6rem; flex: 1; }
.top .count { font-family: var(--sans); font-size: .85rem; color: var(--mute); font-weight: 400; margin-left: 6px; }
.round { width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #f27a3a, #d9480f); box-shadow: var(--emb-sm), var(--glow-brand); }
.round svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.search { margin-bottom: 14px; }
.list { display: grid; gap: 14px; }
.empty { text-align: center; padding: 34px 20px; color: var(--mute); }
.empty .big { font-size: 2.6rem; display: block; margin-bottom: 8px; }

.item { background: var(--card); border-radius: 26px; box-shadow: var(--emb); padding: 16px 18px; }
.item .head { display: flex; align-items: center; gap: 10px; }
.item .name { font-weight: 800; font-size: 1.05rem; flex: 1; min-width: 0; overflow-wrap: anywhere; cursor: pointer; }
.item .sub { color: var(--mute); font-size: .82rem; margin-top: 2px; overflow-wrap: anywhere; }
.pwline { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 8px 8px 14px; border-radius: 18px; background: var(--card); box-shadow: var(--emb-in-sm); }
.pw { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: 1.02rem; overflow-wrap: anywhere; letter-spacing: .06em; }
.pw.dots { letter-spacing: .22em; color: var(--mute); }
.pw:not(.dots) { color: rgba(29, 26, 20, .35); }   /* a revealed password is shown faintly (35%), not full-bold */
.chip { font-size: .7rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--card); box-shadow: var(--emb-in-sm); color: var(--brand-dark); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.chip.ok { color: var(--ok); } .chip.soon { color: #fff; background: var(--brand); box-shadow: var(--glow-brand); }

/* progress: green = done, cheerful stripes = still to go */
.segbar { display: flex; gap: 3px; height: 16px; margin: 14px 0 8px; }
.segbar i { flex: 1; border-radius: 6px; background: var(--joy); }
.segbar i.paid { background: var(--done); box-shadow: inset 0 1px 0 rgba(255,255,255,.45); }
.segbar i.next { box-shadow: 0 0 0 2px rgba(232,89,12,.55); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(232,89,12,.15); } }
.bar { height: 16px; border-radius: 999px; background: var(--joy); overflow: hidden; margin: 14px 0 8px; box-shadow: var(--emb-in-sm); }
.bar b { display: block; height: 100%; border-radius: 999px; background: var(--done); box-shadow: inset 0 1px 0 rgba(255,255,255,.45); }
.split { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; }
.split .ok { color: var(--ok); font-weight: 800; } .split .to-go { color: #b04a00; font-weight: 800; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .82rem; color: var(--mute); }
.facts b { color: var(--ink); }
.next-line { margin-top: 10px; padding: 9px 14px; border-radius: 16px; font-size: .88rem; background: rgba(255,252,240,.55); border: 1px solid var(--line); }
.next-line.soon { background: rgba(255,214,170,.55); border-color: rgba(232,89,12,.35); font-weight: 700; }
.allpaid { text-align: center; color: var(--ok); font-weight: 800; margin-top: 10px; }

/* settings */
.set-card { margin-bottom: 14px; } .set-card h3 { font-family: var(--serif); margin-bottom: 4px; } .set-card .btn { margin-top: 12px; }
.qr { display: block; margin: 12px auto; border-radius: 14px; background: #fff; padding: 8px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; font-family: ui-monospace, Consolas, monospace; font-size: .95rem; }
.codes span { padding: 8px; text-align: center; border-radius: 12px; background: var(--card); box-shadow: var(--emb-in-sm); }
.seg2 { display: flex; padding: 4px; border-radius: 999px; background: var(--card); box-shadow: var(--emb-in-sm); margin-top: 6px; }
.seg2 button { flex: 1; border: 0; background: none; padding: 9px 6px; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--mute); }
.seg2 button.on { background: var(--paper); box-shadow: var(--emb-sm); color: var(--brand-dark); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
details.more { margin-top: 12px; } details.more summary { cursor: pointer; color: var(--brand-dark); font-weight: 700; font-size: .85rem; padding: 4px; }

#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: #1f1d18; color: #fff; padding: 11px 20px; border-radius: 16px; font-size: .9rem; opacity: 0; pointer-events: none; transition: .22s; z-index: 80; max-width: 88vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); } #toast.ok { background: var(--ok); } #toast.bad { background: var(--bad); }

@media (display-mode: standalone) { html, body { overscroll-behavior: none; } body { padding-top: env(safe-area-inset-top); } }
@media (min-width: 700px) { .app { padding-top: 30px; } .auth { margin-top: 9vh; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
