/* Page-level layout. Components are in components.css; colours, spacing and type come from tokens.css. */

/* ---- Home -------------------------------------------------------------------------------------------------------------------- */
.hero { display: grid; gap: var(--space-2); }
.action-grid { display: grid; gap: var(--space-3); }
.action-card { display: grid; grid-template-columns: 52px 1fr 24px; gap: var(--space-4); align-items: center; min-height: 88px; padding: var(--space-4);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
  color: var(--color-text); text-decoration: none; transition: border-color var(--motion-fast), box-shadow var(--motion-fast); }
.action-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-2); }
.action-icon { width: 52px; height: 52px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--color-primary-soft); color: var(--color-primary); }
.action-icon svg { width: 26px; height: 26px; }
.action-card h2 { font-size: var(--text-lg); line-height: var(--leading-lg); }
.action-card p { font-size: var(--text-sm); color: var(--color-text-muted); }
.action-card .chev { width: 22px; height: 22px; color: var(--color-text-muted); }
.trust-note { display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--text-xs); color: var(--color-text-muted); }
.trust-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

/* ---- Capture ----------------------------------------------------------------------------------------------------------------- */
.sensor-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.heading-adjust summary { min-height: var(--touch-min); display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--color-primary); }
.upload-note { display: flex; gap: var(--space-2); align-items: center; font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---- Photo preview with "what we read" overlay ------------------------------------------------------------------------------------ */
.yourphoto { display: grid; gap: var(--space-3); }
.photo-annot { position: relative; line-height: 0; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--color-border); background: #000; max-height: 340px; }
.photo-annot img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; margin: 0 auto; }
.region { position: absolute; border: 2px solid; border-radius: 3px; background: rgba(255, 255, 255, .08); pointer-events: none; }
.region[data-kind="rera"] { border-color: #2ee59d; }
.region[data-kind="project"] { border-color: #ffd23f; }
.region[data-kind="builder"] { border-color: #5cc8ff; }
.region[data-kind="phone"] { border-color: #ff9f6b; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: var(--text-xs); color: var(--color-text-muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 2px solid; vertical-align: -1px; margin-right: 6px; }
.legend [data-kind="rera"] i { border-color: #2ee59d; } .legend [data-kind="project"] i { border-color: #ffd23f; }
.legend [data-kind="builder"] i { border-color: #5cc8ff; } .legend [data-kind="phone"] i { border-color: #ff9f6b; }

/* ---- RERA ID card ------------------------------------------------------------------------------------------------------------------ */
.rera-id { font: 700 var(--text-xl)/1.2 var(--font-mono); letter-spacing: .03em; overflow-wrap: anywhere; }
.rera-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.suggest { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.suggest .btn { font-family: var(--font-mono); }

/* ---- Map ------------------------------------------------------------------------------------------------------------------------------ */
.map { height: 46vh; min-height: 260px; border-radius: var(--radius-lg); border: 1px solid var(--color-border); overflow: hidden; background: var(--color-surface-2); isolation: isolate; position: relative; z-index: 0; }
.map-attrib { font-size: var(--text-xs); color: var(--color-text-muted); }
.map-shell > * + * { margin-top: var(--space-2); }
.pin { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.pin.me { background: #1a73e8; width: 18px; height: 18px; }
.pin.hi { background: #17692f; } .pin.mid { background: #9a5200; } .pin.low { background: #b42318; } .pin.pick { background: #6d28d9; } .pin.reg { background: #004c8f; }
.bf-layer-toggle { background: #fff; color: #14202b; border: 2px solid rgba(0, 0, 0, .25); border-radius: 8px; padding: 0 14px; min-height: var(--touch-min); font: 600 14px system-ui, sans-serif; cursor: pointer; }
.leaflet-container { font: inherit; }

/* ---- Project cards (results, nearby, inside) -------------------------------------------------------------------------------------- */
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.proj-head { display: flex; gap: var(--space-3); align-items: flex-start; }
.proj-head > div { min-width: 0; flex: 1; }
.rank { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary); color: var(--color-on-primary); display: grid; place-items: center; font-weight: 700; font-size: var(--text-sm); }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 700; }
.proj-name { overflow-wrap: anywhere; }
.meta { color: var(--color-text-muted); font-size: var(--text-sm); }
.confidence { display: grid; gap: var(--space-1); }
.confidence-label { font-weight: 700; font-size: var(--text-sm); }
.next-step { font-size: var(--text-sm); color: var(--color-text-muted); }
.thumb-credit { font-size: var(--text-xs); color: var(--color-text-muted); min-height: 1em; margin-top: var(--space-1); }
.thumb-links { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.source-note { font-size: var(--text-xs); color: var(--color-text-muted); }
details.why summary { min-height: var(--touch-min); display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--color-primary); }
details.why ul { margin: 0; padding-left: var(--space-5); }
table.factors { width: 100%; border-collapse: collapse; font-size: var(--text-xs); margin-top: var(--space-2); }
.factors td { padding: 4px; border-top: 1px solid var(--color-border); vertical-align: top; }
.factors td:nth-child(2) { white-space: nowrap; text-align: right; }

/* Direction arrow on nearby items */
.bearing { display: inline-flex; align-items: center; gap: var(--space-1); font-weight: 600; }
.bearing svg { width: 18px; height: 18px; transition: transform var(--motion-base); }

/* ---- Auth pages --------------------------------------------------------------------------------------------------------------------- */
.auth-card { max-width: 420px; margin: var(--space-6) auto 0; }
.auth-card form { display: grid; gap: var(--space-4); }
.result-box { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-3); overflow: auto; font-family: var(--font-mono); font-size: var(--text-xs); }

@media (min-width: 720px) {
  .action-grid { grid-template-columns: repeat(3, 1fr); }
  .action-card { grid-template-columns: 1fr; grid-template-rows: auto auto; align-items: start; min-height: 170px; }
  .action-card .chev { display: none; }
  .map { height: 52vh; }
}

/* Leaflet controls sized for a thumb */
.map.leaflet-container .leaflet-bar a { width: var(--touch-min); height: var(--touch-min); line-height: var(--touch-min); }
.map.leaflet-container .leaflet-control-attribution a { display: inline-block; padding: 14px 2px; }

/* Footer link */
.page > p.small a { display: inline-flex; align-items: center; min-height: var(--touch-min); }
