/* Plain pages without the 3D view: login, invite, reset, dashboard, admin,
   legal. Loaded after app.css, which has the colours, fonts and buttons. */
html, body { height: auto; min-height: 100%; overflow: auto; }
body.page {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(123, 129, 103, 0.22), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(240, 194, 122, 0.08), transparent 60%),
    var(--night);
}
.page-wrap { position: relative; z-index: 2; min-height: 100vh; display: flex; flex-direction: column; padding: 0 16px; }
.page-head { display: flex; align-items: center; gap: 14px; max-width: 1100px; width: 100%; margin: 0 auto; padding: 22px 0; }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.wordmark span { color: var(--brass); }
.page-head .spacer { flex: 1; }
.page-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; }
.page-main.narrow { max-width: 440px; display: flex; flex-direction: column; justify-content: center; padding-bottom: 8vh; }
.page-foot { max-width: 1100px; width: 100%; margin: 0 auto; padding: 24px 0 28px; }
.page-foot .copyright { margin: 0; animation: none; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px);
}
.card h1 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 40px; line-height: 0.95; margin: 0 0 10px; }
.card .lede { color: var(--ink-dim); margin: 0 0 22px; line-height: 1.5; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-dim); font-weight: 600; letter-spacing: 0.02em; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=number], .form input[type=date], .form select, .form textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05);
  color: var(--ink); font-size: 15px; font-weight: 400; outline: none; transition: border-color 0.15s, background 0.15s;
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--brass); background: rgba(255, 255, 255, 0.08); }
.form select option { background: var(--panel-solid); }
.form .check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; line-height: 1.45; }
.form .check input { margin-top: 3px; accent-color: var(--brass); }
.form .check a { color: var(--brass); }
.form .actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.form .btn.primary { padding: 11px 22px; font-size: 15px; }
.form .hint { font-size: 12px; color: var(--ink-faint); font-weight: 400; }

.alert { border-radius: 10px; padding: 10px 13px; font-size: 13.5px; line-height: 1.45; border: 1px solid; }
.alert.err { color: #ffc2b8; border-color: rgba(224, 90, 71, 0.5); background: rgba(224, 90, 71, 0.1); }
.alert.ok { color: #cdeec9; border-color: rgba(143, 201, 138, 0.45); background: rgba(143, 201, 138, 0.1); }
.alert.info { color: var(--ink); border-color: var(--line); background: rgba(255, 255, 255, 0.04); }

.muted { color: var(--ink-dim); }
.mono { font-family: var(--mono); }
a.link { color: var(--brass); }

@media (max-width: 520px) {
  .card { padding: 20px; }
  .card h1 { font-size: 32px; }
}

/* ---------- Tables and tabs (admin, dashboard) ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 20px; overflow-x: auto; }
.tabs button {
  border: 0; background: transparent; color: var(--ink-dim); padding: 10px 14px; cursor: pointer; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--brass); }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }
.section-head h2 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 26px; margin: 0; }
.section-head .spacer { flex: 1; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); font-weight: 600; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
table.data .actions { display: flex; gap: 6px; flex-wrap: wrap; }
table.data input[type=number] { width: 70px; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255,255,255,0.05); color: var(--ink); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(143, 201, 138, 0.4); }
.pill.warn { color: var(--brass); border-color: rgba(240, 194, 122, 0.4); }
.pill.err { color: #ffb3a8; border-color: rgba(224, 90, 71, 0.5); }
.pill.dim { color: var(--ink-faint); }
.copybox { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.copybox input { flex: 1; font-family: var(--mono); font-size: 13px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.stats { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 16px; color: var(--ink-dim); font-size: 13px; }
.stats b { color: var(--ink); font-family: var(--mono); font-weight: 500; }
dialog.card { color: var(--ink); max-width: 420px; width: calc(100% - 32px); }
dialog.card::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); }
dialog:not([open]) { display: none !important; }
a.btn { color: inherit; text-decoration: none; }

/* ---------- Dashboard ---------- */
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 230px; padding: 8px;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; gap: 2px;
}
.menu-email { font-size: 12px; padding: 6px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow-wrap: anywhere; }
.menu-item { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.menu-item:hover { background: rgba(255,255,255,0.06); }
.menu-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px; font-size: 13px; }
.menu-row select { background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.menu-row select option { background: var(--panel-solid); }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.fp-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.fp-thumb { aspect-ratio: 4 / 3; background: #0f0f0e; display: grid; place-items: center; border-bottom: 1px solid var(--line); text-decoration: none; }
.fp-thumb svg, .fp-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fp-thumb img { filter: invert(0.9) hue-rotate(180deg) brightness(0.9); opacity: 0.8; }
.fp-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.fp-name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.fp-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--ink-dim); }
.fp-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
dialog.card.wide { max-width: 620px; }
.dlg-title { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 28px; margin: 0; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-btn {
  text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,0.04); line-height: 1.4;
}
.choice-btn:hover:not(:disabled) { border-color: var(--brass); background: rgba(240,194,122,0.06); }
.choice-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.choice-btn span { color: var(--ink-dim); font-size: 13px; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 320px; overflow: auto; }
.page-grid button { border: 2px solid var(--line); border-radius: 8px; padding: 4px; background: #0f0f0e; cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: center; font-size: 12px; }
.page-grid button[aria-pressed=true] { border-color: var(--brass); }
.page-grid img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 4px; }
@media (max-width: 560px) { .choice { grid-template-columns: 1fr; } }

/* ---------- Legal pages ---------- */
.legal { max-width: 760px; padding-bottom: 40px; line-height: 1.6; }
.legal h1 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 44px; margin: 10px 0 6px; }
.legal h2 { font-size: 18px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--ink-dim); }
.legal strong { color: var(--ink); }
.legal a { color: var(--brass); }
.legal table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.legal th, .legal td { text-align: left; border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
.legal th { color: var(--ink-faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.legal .draft { margin: 0 0 18px; }
.menu-item { color: var(--ink); text-decoration: none; font-size: 14px; }
.menu-item.danger:hover { color: #ffb3a8; }

/* ---------- Upload: the scale the drawing needs ---------- */
.scale-note { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(240, 194, 122, 0.45); background: rgba(240, 194, 122, 0.07); }
.scale-note svg { width: 110px; flex: none; color: var(--brass); }
.scale-note b { display: block; margin-bottom: 3px; }
.scale-note p { margin: 0; color: var(--ink-dim); font-size: 13.5px; line-height: 1.45; }
@media (max-width: 480px) { .scale-note { flex-direction: column; align-items: flex-start; } }

/* ---------- Dashboard: the first floor plan ---------- */
.onboard { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 28px; max-width: 760px; }
.onboard h2 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 34px; margin: 0 0 6px; }
.onboard > p { margin: 0 0 18px; line-height: 1.5; }
.onboard-steps { list-style: none; counter-reset: s; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.onboard-steps li { counter-increment: s; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; line-height: 1.45; }
.onboard-steps li::before { content: counter(s); font-family: var(--display); font-weight: 800; font-size: 30px; color: var(--brass); line-height: 1; }
.onboard-steps span { color: var(--ink-dim); font-size: 13.5px; }
@media (max-width: 680px) { .onboard-steps { grid-template-columns: 1fr; } }
