
:root {
  --ink: #171411;
  --cream: #eee8df;
  --paper: #f7f3ed;
  --surface: #fffdf9;
  --tomato: #e10600;
  --tomato-dark: #a91a14;
  --green: #607885;
  --gold: #b07e43;
  --muted: #716b64;
  --line: rgba(23,20,17,.13);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, sans-serif;
}

button,
input,
select { font: inherit; }

a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
  background: var(--paper);
}

.portal-visual {
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: 34px;
  position: relative;
  background:
    linear-gradient(180deg, transparent 54%, rgba(17,9,5,.64)),
    url("mesa-pizzas.jpg") center / cover no-repeat;
}

.portal-visual span {
  color: white;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.portal-card {
  width: min(100%, 560px);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 6vw, 76px);
  background: var(--surface);
  border-left: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(36px, 7vh, 64px);
}

.brand-logo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
}

.eyebrow { margin: 0; }
.eyebrow {
  color: var(--tomato);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.welcome-copy { padding: 0 0 30px; }
.wifi-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  color: #4f4943;
  background: #f1ede7;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}
.wifi-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tomato);
}

h1 {
  max-width: 420px;
  margin: 12px 0 13px;
  font-family: Georgia, serif;
  font-size: clamp(38px, 6vw, 56px);
  line-height: 1.02;
  letter-spacing: -.04em;
}
.welcome-copy > p {
  margin: 0;
  max-width: 430px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.access-form { display: grid; gap: 17px; }
.field { display: grid; gap: 7px; }
.field label,
.field legend {
  font-size: 13px;
  font-weight: 700;
}
.field label span,
.field legend span { color: var(--muted); font-weight: 500; }
.field input,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus,
.field select:focus {
  border-color: var(--tomato);
  box-shadow: 0 0 0 4px rgba(225,6,0,.09);
}
.phone-input {
  display: grid;
  grid-template-columns: auto 1fr;
}
.phone-code {
  display: grid;
  place-items: center;
  min-width: 62px;
  color: #5f625c;
  background: #f2eee6;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  font-size: 14px;
}
.phone-input input { border-radius: 0 10px 10px 0; }
.birthday-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.birthday-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: 10px; }
.birthday-field small { color: var(--muted); font-size: 11px; line-height: 1.4; }

.consent {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 11px;
  align-items: start;
  color: #5c5e58;
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
}
.consent input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--tomato);
}
.consent a { color: var(--tomato-dark); font-weight: 700; }
.consent-optional {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}
.consent-note {
  margin: 0;
  color: #6b6d67;
  font-size: 11px;
  line-height: 1.45;
}
.consent-note a { color: var(--tomato-dark); font-weight: 700; }

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.connect-button {
  min-height: 56px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--tomato);
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
  transition: transform .2s, background .2s;
}
.connect-button:hover { background: var(--tomato-dark); transform: translateY(-1px); }
.connect-button:disabled { opacity: .65; cursor: wait; transform: none; }
.button-link {
  display: grid;
  place-items: center;
  text-decoration: none;
}
.form-error {
  margin: -5px 0 0;
  color: #9b2b21;
  font-size: 12px;
  text-align: center;
}

.success-panel {
  padding: 8px 0 3px;
  text-align: center;
}
.success-icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  color: white;
  background: var(--tomato);
  font-size: 30px;
}
.success-panel h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 30px;
}
.success-panel p {
  margin: 9px auto 20px;
  color: #64655e;
  line-height: 1.5;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  color: #8b847c;
  font-size: 10px;
  letter-spacing: .03em;
}
footer a { text-underline-offset: 3px; }

.portal-shell--simple {
  grid-template-columns: 1fr;
  place-items: center;
  padding: 28px;
}
.portal-shell--simple .portal-card {
  min-height: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.crm-shell {
  min-height: 100svh;
  padding: 28px;
  background:
    radial-gradient(circle at 90% 5%, rgba(176,126,67,.18), transparent 28%),
    var(--paper);
}

.crm-dashboard {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.crm-header,
.crm-brand,
.crm-user,
.crm-toolbar,
.crm-search {
  display: flex;
  align-items: center;
}

.crm-header {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.crm-brand { gap: 13px; }
.crm-brand img,
.crm-access-card img { border-radius: 4px; }
.crm-brand h1 {
  margin: 2px 0 0;
  font-size: clamp(28px, 5vw, 42px);
}

.crm-user { gap: 15px; font-size: 13px; }
.crm-user a,
.text-link { color: var(--tomato); font-weight: 800; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  min-height: 132px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 34px rgba(26,34,37,.06);
}

.metric-card strong {
  font-family: Georgia, serif;
  color: var(--tomato-dark);
  font-size: 38px;
  line-height: 1;
}

.metric-card span { color: #666861; font-size: 13px; }

.crm-toolbar {
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 13px;
}

.crm-search { flex: 1; max-width: 570px; }
.crm-search input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px 0 0 4px;
  outline: none;
}
.crm-search input:focus { border-color: var(--tomato); }
.crm-search button,
.export-button {
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 0 18px;
  color: white;
  background: var(--tomato);
  border: 0;
  border-radius: 0 4px 4px 0;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.export-button { border-radius: 4px; background: var(--ink); }

.crm-table-wrap {
  overflow-x: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 34px rgba(26,34,37,.05);
}

.crm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.crm-table th,
.crm-table td {
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
.crm-table th {
  color: #6e6d65;
  background: #f7f4ee;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.crm-table tbody tr:last-child td { border-bottom: 0; }
.crm-table td:first-child { font-weight: 750; }
.crm-table td a { color: var(--tomato); }
.status {
  display: inline-block;
  min-width: 34px;
  padding: 4px 8px;
  color: #77776f;
  background: #efede8;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.status.yes { color: #355b43; background: #e3efe6; }
.empty-table { padding: 36px !important; color: #77776f; text-align: center !important; }
.crm-note { color: #77776f; font-size: 12px; }

.crm-access-card {
  width: min(500px, 100%);
  margin: 10vh auto 0;
  padding: 38px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(26,34,37,.11);
}
.crm-access-card h1 { margin-bottom: 16px; }
.crm-access-card > p:not(.eyebrow) { color: #64655e; line-height: 1.6; }

.router-dashboard { max-width: 980px; }
.router-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 34px;
  color: white;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(26,34,37,.14);
}
.router-hero h2 { margin: 14px 0 9px; font: 700 clamp(28px, 4vw, 42px)/1.05 Georgia, serif; }
.router-hero p { max-width: 610px; margin: 0; color: #d9d8d3; line-height: 1.6; }
.router-open-button {
  flex: 0 0 auto;
  min-height: 50px;
  display: grid;
  place-items: center;
  padding: 0 22px;
  color: white;
  background: var(--tomato);
  border-radius: 5px;
  font-weight: 800;
  text-decoration: none;
}
.router-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.router-card { padding: 24px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.router-card > span { color: var(--tomato); font-size: 12px; font-weight: 900; }
.router-card h3 { margin: 15px 0 8px; font-size: 18px; }
.router-card p { margin: 0; color: #666861; font-size: 14px; line-height: 1.55; }
.router-note { margin-top: 16px; padding: 18px 20px; color: #64655e; background: #f2eee6; border-radius: 6px; font-size: 13px; }

@media (max-width: 760px) {
  .portal-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 148px auto;
  }
  .portal-visual {
    min-height: 148px;
    padding: 18px 22px;
    background-position: center 58%;
  }
  .portal-visual span { font-size: 10px; }
  .portal-card {
    min-height: calc(100svh - 148px);
    width: 100%;
    justify-content: flex-start;
    padding: 0 23px 22px;
    border: 0;
    border-radius: 0;
  }
  .crm-header,
  .router-hero { align-items: flex-start; flex-direction: column; }
  .crm-user { flex-wrap: wrap; }
  .router-grid { grid-template-columns: 1fr; }
  .brand {
    align-items: flex-end;
    margin: -38px 0 30px;
  }
  .brand-logo {
    width: 76px;
    height: 76px;
    border: 5px solid var(--surface);
    border-radius: 16px;
  }
  .wifi-pill { margin-bottom: 5px; }
  .welcome-copy { padding-bottom: 26px; }
  h1 { font-size: 40px; }
  footer { margin-top: auto; padding-top: 24px; }

  .portal-shell--simple {
    display: grid;
    min-height: 100svh;
    padding: 0;
  }
  .portal-shell--simple .portal-card {
    min-height: 100svh;
    padding: 28px 23px;
    border: 0;
    border-radius: 0;
  }

  .crm-shell { padding: 18px 14px; }
  .crm-header { align-items: flex-start; }
  .crm-user { align-items: flex-end; flex-direction: column; gap: 5px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-card { min-height: 108px; padding: 16px; }
  .metric-card strong { font-size: 31px; }
  .crm-toolbar { align-items: stretch; flex-direction: column; }
  .crm-search { max-width: none; }
  .export-button { width: 100%; }
  .crm-access-card { margin-top: 4vh; padding: 28px 24px; }
}

[hidden] { display: none !important; }
.privacy { margin-top: 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.privacy summary { cursor: pointer; }
