/* House2House design system
   Palette: mist / ink / sky / harbor / amber
   Type: Manrope variable (self-hosted), system fallback */

@font-face {
  font-family: 'Manrope';
  src: url('/assets/fonts/manrope-var.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --mist: #EDF4FA;        /* page background */
  --surface: #FFFFFF;
  --ink: #14293C;         /* primary text */
  --ink-soft: #52708A;    /* secondary text */
  --sky: #2E8FC7;         /* primary action */
  --harbor: #1E6DA0;      /* hover / deep */
  --amber: #E8A13C;       /* sparing highlight */
  --line: #D5E2EE;
  --ok: #2F9E6E;
  --err: #C2483F;
  --brand: var(--sky);    /* overridden per tenant */
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 41, 60, .06), 0 6px 20px rgba(20, 41, 60, .07);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--mist);
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .5rem; }
h1 { font-size: 1.7rem; font-weight: 750; }
h2 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 .9rem; }
a { color: var(--harbor); }
code { font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace; font-size: .92em; }
.muted { color: var(--ink-soft); }
.small { font-size: .86rem; }

/* ---- Chrome ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem 1.1rem;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); font-weight: 750; }
.mark { width: 24px; height: 24px; color: var(--brand); }
.brand-name { letter-spacing: .01em; }
.tenant-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-left: .35rem; padding: .18rem .6rem;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: .82rem; font-weight: 600; color: var(--ink-soft);
}
.tenant-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.topnav { display: flex; align-items: center; gap: .9rem; }
.topnav a { text-decoration: none; font-weight: 600; font-size: .95rem; }
.inline { display: inline; }

.wrap { max-width: 1040px; margin: 1.6rem auto 3rem; padding: 0 1.1rem; }

.footer {
  display: flex; justify-content: space-between; gap: 1rem;
  max-width: 1040px; margin: 0 auto; padding: 1rem 1.1rem 2rem;
  font-size: .85rem; color: var(--ink-soft);
}

/* ---- Cards, tables, grid ---- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem; margin-bottom: 1.2rem;
}
.center-card { max-width: 480px; margin: 3rem auto; text-align: center; }
.page-head { margin-bottom: 1.1rem; }
.page-head p { margin: 0; }

.grid.modules {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem; margin-bottom: 1.2rem;
}
.module { margin-bottom: 0; border-top: 3px solid var(--brand); }
.module-off { border-top-color: var(--line); opacity: .75; }
.role-chip {
  display: inline-block; margin: 0 0 .4rem;
  padding: .12rem .55rem; border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, white);
  color: var(--harbor); font-size: .8rem; font-weight: 700;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.row-actions { white-space: nowrap; }
.row-actions form { margin-left: .25rem; }
.swatch { display: inline-block; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line); }

/* ---- Forms ---- */
.stack label { display: block; font-weight: 650; font-size: .92rem; margin-bottom: .9rem; }
.stack input {
  display: block; width: 100%; margin-top: .3rem;
  padding: .58rem .7rem; font: inherit; color: var(--ink);
  background: #FBFDFF; border: 1px solid var(--line); border-radius: 8px;
}
.stack input:focus { outline: 2px solid var(--sky); outline-offset: 1px; border-color: var(--sky); }
.stack input[type="color"] { width: 64px; height: 40px; padding: .15rem; }
.form-narrow { max-width: 460px; }

.btn {
  display: inline-block; padding: .5rem .95rem;
  font: inherit; font-weight: 700; font-size: .93rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--sky); color: var(--harbor); }
.btn:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.btn-primary { background: var(--sky); border-color: var(--sky); color: #fff; }
.btn-primary:hover { background: var(--harbor); border-color: var(--harbor); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { border-color: var(--line); }
.btn-danger { color: var(--err); }
.btn-danger:hover { border-color: var(--err); color: var(--err); }
.btn-small { padding: .28rem .6rem; font-size: .84rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---- Flash messages ---- */
.flash { padding: .65rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 600; font-size: .93rem; }
.flash-ok { background: #E7F5EE; color: #1D6B49; border: 1px solid #BFE3D0; }
.flash-error { background: #FBEAE8; color: #96352E; border: 1px solid #EFC6C2; }

/* ---- Auth screens ---- */
.auth-body {
  min-height: 100vh; margin: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(60rem 30rem at 85% -10%, color-mix(in srgb, var(--sky) 14%, transparent), transparent),
    var(--mist);
}
.auth-wrap { width: min(430px, 92vw); padding: 2rem 0; }
.auth-mark {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin-bottom: 1rem; font-weight: 800; font-size: 1.05rem; color: var(--ink);
}
.auth-mark svg { width: 26px; height: 26px; color: var(--sky); }
.auth-card { padding: 1.6rem 1.7rem; position: relative; }
/* Signature: the gable. A thin roofline that peaks at the top of the card. */
.gable::before {
  content: ''; position: absolute; top: -1px; left: -1px; right: -1px; height: 4px;
  background: linear-gradient(90deg, var(--sky) 0 calc(50% - 14px), var(--amber) calc(50% - 14px) calc(50% + 14px), var(--sky) calc(50% + 14px) 100%);
  border-radius: var(--radius) var(--radius) 0 0;
}
.auth-foot { text-align: center; margin-top: 1rem; font-size: .85rem; }

.qr { width: 190px; margin: 0 auto .6rem; }
.qr svg { display: block; width: 100%; height: auto; }
.secret {
  display: block; text-align: center; margin: 0 0 1.1rem;
  padding: .45rem; background: var(--mist); border-radius: 8px;
  letter-spacing: .08em; word-break: break-all;
}
.codes { columns: 2; padding-left: 1.2rem; margin: 0 0 1.2rem; }
.codes li { margin-bottom: .35rem; }

/* ---- Public landing ---- */
.hero { text-align: center; padding: 3.5rem 1rem 2.5rem; }
.eyebrow {
  display: inline-block; margin-bottom: .8rem; padding: .2rem .75rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: .82rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--harbor);
}
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); font-weight: 800; margin-bottom: .6rem; }
.lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 40rem; margin: 0 auto 1.4rem; }
.hero-actions { display: flex; justify-content: center; gap: .7rem; flex-wrap: wrap; margin-bottom: 1rem; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .codes { columns: 1; }
  .footer { flex-direction: column; gap: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.stack select.select {
  display: block; width: 100%; margin-top: .3rem;
  padding: .58rem .7rem; font: inherit; color: var(--ink);
  background: #FBFDFF; border: 1px solid var(--line); border-radius: 8px;
}
