/* Customer portal (/app) - shared mobile-first styling.
   Deliberately matches BWPMG/public/pay.html so the portal and the pay page
   feel like one product. */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600&family=Inter:wght@400;500;600;700&display=swap");

/* Brand matches the bwpmg.com marketing site (bwpmg-refresh/assets/site.css). */
:root {
    --green:#2e8b57; --green-d:#1f6b42; --green-bg:#e3f2e9; --ink:#1b2430; --navy:#0f2a44; --muted:#5b6675;
    --line:#e5e1d8; --bg:#f7f5f0; --danger:#c0392b; --amber:#8a4c10;
    --amber-bg:#fbeedd; --amber-line:#f0d5b0; --blue:#1a3d61;
    --display:"Fraunces", Georgia, serif;
}
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
body { margin:0; font-family:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; background:var(--bg); color:var(--ink); -webkit-font-smoothing:antialiased; }

header { position:relative; overflow:hidden; background:linear-gradient(120deg,#0f2a44 0%,#16385a 70%,#1b4a5c 100%); color:#fff;
         padding:18px 18px 34px; padding-top:calc(18px + env(safe-area-inset-top,0)); }
header::before { content:""; position:absolute; right:-140px; top:-140px; width:380px; height:380px; border-radius:50%;
                 background:radial-gradient(circle,rgba(46,139,87,.35),transparent 65%); pointer-events:none; }
header > * { position:relative; max-width:560px; margin-left:auto; margin-right:auto; }
.brand { display:flex; align-items:center; gap:10px; font-size:14px; font-weight:600; letter-spacing:0; text-transform:none; opacity:1;
         color:#fff; text-decoration:none; margin-bottom:18px; }
.brand::before { content:"BW"; display:grid; place-items:center; width:34px; height:34px; border-radius:9px; background:#fff; color:var(--navy);
                 font:700 13px/1 var(--display); flex-shrink:0; }
header h1 { margin:6px auto 2px; font:600 27px/1.15 var(--display); letter-spacing:-.01em; }
header .addr { font-size:14px; color:#c9d6e3; }
header .back { display:block; font-size:14px; color:#9fd6b5; text-decoration:none; margin-bottom:2px; }
header .back::before { content:"\2190\00a0"; }
header .back:active { opacity:.8; }

main { max-width:560px; margin:-18px auto 48px; padding:0 14px; position:relative; }
.card { background:#fff; border:1px solid var(--line); border-radius:16px; padding:18px; margin-bottom:14px; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.card h2 { margin:0 0 4px; font:600 20px/1.25 var(--display); color:var(--navy); }
.card h2.pending { color:var(--amber); }
.card .sub { font-size:13.5px; color:var(--muted); margin:0 0 12px; line-height:1.5; }

/* Menu tiles - the six buttons from the legacy main menu */
.menu { display:grid; gap:10px; }
.tile { display:block; width:100%; text-align:left; background:#fff; border:1px solid var(--line); border-radius:12px;
        padding:14px 16px; cursor:pointer; font:inherit; color:inherit; text-decoration:none; position:relative; }
.tile:active { background:#f9fafb; }
.tile .t { font-size:16px; font-weight:700; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.tile .d { font-size:13px; color:var(--muted); margin-top:3px; line-height:1.45; }
.tile .chev { color:var(--muted); font-weight:400; flex-shrink:0; }
.tile[disabled] { opacity:.55; cursor:default; }
.tile .pill { display:inline-block; font-size:11.5px; font-weight:700; border-radius:999px; padding:2px 9px; margin-left:8px; vertical-align:2px; }
.pill.count { background:#fef3c7; color:var(--amber); }
.pill.soon { background:#f3f4f6; color:var(--muted); }

/* Buttons */
.btn { display:block; width:100%; text-align:center; border:none; border-radius:999px; box-shadow:0 6px 18px rgba(46,139,87,.25); background:var(--green); color:#fff;
       font-size:17px; font-weight:700; padding:15px; cursor:pointer; margin-top:14px; font-family:inherit; }
.btn:disabled { opacity:.55; cursor:default; }
.btn.secondary { background:#fff; color:var(--ink); border:1px solid var(--line); box-shadow:none; }
.btn.blue { background:var(--blue); }
.btn.danger { background:#fff; color:var(--danger); border:1px solid #fecaca; }
.btn.small { font-size:15px; padding:11px; margin-top:8px; }
.btnrow { display:flex; gap:8px; }
.btnrow .btn { flex:1; }

/* Forms */
label.f { display:block; font-size:13px; font-weight:600; color:var(--muted); margin:12px 0 5px; }
input[type=text], input[type=tel], input[type=email], select, textarea {
    width:100%; font:inherit; font-size:16px; padding:12px 13px; border:1px solid var(--line);
    border-radius:10px; background:#fff; color:var(--ink); -webkit-appearance:none; appearance:none;
}
select { background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='%236b7280' d='M5 8l5 5 5-5z'/></svg>");
         background-repeat:no-repeat; background-position:right 10px center; background-size:20px; padding-right:36px; }
textarea { min-height:110px; resize:vertical; line-height:1.5; }
input:focus, select:focus, textarea:focus { outline:2px solid var(--green); outline-offset:-1px; border-color:var(--green); }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.readonly { background:#f9fafb; color:var(--muted); }

/* Radio / choice lists */
.choices { display:grid; gap:8px; margin-top:6px; max-height:340px; overflow-y:auto; }
.choice { display:flex; align-items:flex-start; gap:10px; padding:12px 13px; border:1px solid var(--line);
          border-radius:10px; cursor:pointer; font-size:15px; background:#fff; }
.choice input { width:19px; height:19px; accent-color:var(--green); flex-shrink:0; margin:0; }
.choice.sel { border-color:var(--green); background:var(--green-bg); }
.choice .cd { font-size:12.5px; color:var(--muted); margin-top:2px; }

/* Service rows */
.svc { padding:14px 0; border-bottom:1px solid var(--line); }
.svc:last-child { border-bottom:none; padding-bottom:0; }
.svc:first-child { padding-top:0; }
.svc .top { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.svc .nm { font-weight:700; font-size:15.5px; }
.svc .amt { font-weight:700; font-size:15.5px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.svc .amt small { display:block; font-weight:600; font-size:11.5px; color:var(--muted); text-align:right; }
.svc .meta { font-size:13px; color:var(--muted); margin-top:3px; line-height:1.5; }
.svc .notes { font-size:13.5px; margin-top:6px; color:#374151; line-height:1.5; word-break:break-word; }
.svc .acts { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.svc .acts button, .svc .acts a { font:inherit; font-size:13.5px; font-weight:600; padding:8px 13px; border-radius:9px;
    border:1px solid var(--line); background:#fff; color:var(--ink); cursor:pointer; text-decoration:none; }
.svc .acts button.go { background:var(--green); border-color:var(--green); color:#fff; }
.svc .acts button.warn { color:var(--danger); border-color:#fecaca; }
.urgentchip { font-size:11.5px; font-weight:700; color:#991b1b; background:#fee2e2; border-radius:6px; padding:2px 8px; margin-left:6px; }

/* Banners + misc */
.ok { background:var(--green-bg); color:var(--green-d); border:1px solid #bfe3cd; border-radius:10px; padding:12px 14px; font-size:14.5px; margin-bottom:14px; }
.err { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; border-radius:10px; padding:12px 14px; font-size:14.5px; margin-bottom:14px; }
.note { background:var(--amber-bg); border:1px solid var(--amber-line); color:#5e3a12; border-radius:10px; padding:12px 14px; font-size:13.5px; line-height:1.55; }
.empty { text-align:center; color:var(--muted); padding:34px 16px; font-size:14.5px; line-height:1.55; }
.foot { text-align:center; color:var(--muted); font-size:12.5px; margin-top:20px; line-height:1.6; }
.foot a { color:var(--muted); }
.big { font-size:32px; font-weight:800; font-variant-numeric:tabular-nums; margin:2px 0 0; }
.big-label { font-size:13px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.hr { height:1px; background:var(--line); margin:16px 0; }
.center { text-align:center; }
.linkish { color:var(--green-d); font-weight:600; text-decoration:none; cursor:pointer; font-size:14px; }
.spin { display:inline-block; width:14px; height:14px; border:2px solid rgba(255,255,255,.4); border-top-color:#fff;
        border-radius:50%; animation:sp .7s linear infinite; vertical-align:-2px; margin-right:7px; }
@keyframes sp { to { transform:rotate(360deg); } }
.hide { display:none !important; }

/* Message thread */
.msg { padding:12px 14px; border-radius:12px; margin-bottom:10px; font-size:14.5px; line-height:1.55; word-break:break-word; }
.msg.client { background:var(--green-bg); border:1px solid #bfe3cd; margin-left:28px; }
.msg.contractor, .msg.system { background:#fff; border:1px solid var(--line); margin-right:28px; }
.msg .who { font-size:12px; font-weight:700; color:var(--muted); margin-bottom:4px; }
.msg img { max-width:100%; height:auto; border-radius:8px; display:block; margin-top:6px; }

/* ---------- One-page request (/app/request) ---------- */
.lead { font-size:15px; color:#d6e1ec; margin:6px auto 0; line-height:1.55; }
.chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:14px; }
.chips span { font-size:12.5px; font-weight:600; color:#fff; background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.18);
              border-radius:999px; padding:5px 10px; }
.step { display:flex; align-items:center; gap:10px; margin:22px 0 4px; font:600 18px/1.2 var(--display); color:var(--navy); }
.step:first-child { margin-top:0; }
.step b { display:grid; place-items:center; width:26px; height:26px; border-radius:50%; background:var(--navy); color:#fff;
          font:600 13px/1 "Inter",sans-serif; flex-shrink:0; }
.opt-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:10px; }
.opt { position:relative; display:block; border:1.5px solid var(--line); border-radius:14px; padding:14px 14px 13px; cursor:pointer;
       background:#fff; transition:border-color .15s, background .15s, box-shadow .15s; }
.opt input { position:absolute; opacity:0; pointer-events:none; }
.opt .ot { display:block; font-weight:700; font-size:15.5px; color:var(--ink); }
.opt .op { display:block; font:600 21px/1.2 var(--display); color:var(--green-d); margin-top:4px; }
.opt .op small { font:500 12.5px "Inter",sans-serif; color:var(--muted); }
.opt .od { display:block; font-size:12.5px; color:var(--muted); margin-top:3px; line-height:1.4; }
.opt:has(input:checked) { border-color:var(--green); background:var(--green-bg); box-shadow:0 0 0 3px rgba(46,139,87,.15); }
.opt:has(input:focus-visible) { outline:2px solid var(--green); outline-offset:2px; }
.opt .tick { position:absolute; top:10px; right:10px; width:20px; height:20px; border-radius:50%; border:1.5px solid var(--line); background:#fff; }
.opt:has(input:checked) .tick { border-color:var(--green); background:var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat; }
.row3 { display:grid; grid-template-columns:1.4fr 1fr; gap:10px; }
.consent { display:flex; gap:10px; align-items:flex-start; font-size:13px; color:var(--muted); line-height:1.5; margin-top:16px; cursor:pointer; }
.consent input { width:19px; height:19px; margin:1px 0 0; accent-color:var(--green); flex-shrink:0; }
.fine { font-size:12.5px; color:var(--muted); text-align:center; margin-top:10px; line-height:1.5; }
details.more { margin-top:14px; }
details.more summary { cursor:pointer; font-size:14px; font-weight:600; color:var(--green-d); list-style:none; }
details.more summary::-webkit-details-marker { display:none; }
details.more summary::before { content:"+ "; }
details.more[open] summary::before { content:"\2212  "; }
.hp { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }
.code-input { font-size:28px !important; letter-spacing:.4em; text-align:center; font-variant-numeric:tabular-nums; }
.done { text-align:center; padding:8px 4px; }
.done .mark { width:64px; height:64px; border-radius:50%; margin:4px auto 14px; background:var(--green-bg)
              url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%231f6b42' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/55% no-repeat; }
.done h2 { font-size:24px !important; }
.done p { font-size:15px; color:var(--muted); line-height:1.6; margin:8px 0 0; }
.summary { text-align:left; background:var(--bg); border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin-top:16px; font-size:14px; line-height:1.7; }
.summary b { color:var(--ink); }
@media (max-width:340px) { .opt-grid, .row3 { grid-template-columns:1fr; } }
