/* OSCAR Portal, in the website's own clothes: paper, ink, Raleway, and the
   coral-to-pink the brand wears (tokens mirrored from oscar-site/site.css). */

@font-face {
  font-family: "Raleway";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/raleway-latin-wght-normal.woff2") format("woff2");
}

:root {
  --coral: #ff5a36;
  --pink: #ff3663;
  --brand: linear-gradient(100deg, var(--coral), var(--pink));
  --ink: #2b2b33;
  --soft: #6b6b78;
  --line: #e6e6ec;
  --paper: #ffffff;
  --wash: #f4f4f7;
  --good: #1d9e50;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--wash);
  color: var(--ink);
  /* The type is Gotham where the device has it (the brand's face; it is a
     commercial font, so it cannot ride along) -- then its nearest free
     shapes, then the Raleway we do ship. Same chain as the Showcase. */
  font: 400 16px/1.65 "Gotham", "Gotham Book", "Gotham SSm A", "Montserrat", "Raleway", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "lnum";
}

/* The website's own header: the brand band, the white logo at 36px. */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 24px;
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
}
.top .logo {
  display: flex;
}
.top .logo img {
  height: 36px;
  width: auto;
}
.portal-word {
  font-weight: 600;
  letter-spacing: 0.08em;
  opacity: 0.9;
  padding-top: 2px;
}

.who[hidden] {
  display: none;
}
.who {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  color: #ffffff;
  font-size: 14px;
}
.btn.ghost.light {
  color: #ffffff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75);
}
.btn.ghost.light:hover {
  box-shadow: inset 0 0 0 2px #ffffff;
}

main {
  flex: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 24px 22px;
  margin: 0 0 16px;
  box-shadow: 0 10px 30px -18px rgba(43, 43, 51, 0.25);
}

h1 {
  font-size: 24px;
  margin: 0 0 6px;
  font-weight: 800;
}
h2 {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--soft);
  margin: 0 0 14px;
  font-weight: 700;
}

.muted {
  color: var(--soft);
}
.small {
  font-size: 13px;
}
.note {
  color: var(--pink);
  font-size: 14px;
}

.row {
  display: flex;
  gap: 10px;
}
.row.gap {
  margin-top: 8px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--soft);
  margin: 16px 0 6px;
}

input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
input:focus {
  outline: 2px solid var(--pink);
  outline-offset: 0;
  border-color: transparent;
}

.btn {
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px -8px rgba(255, 54, 99, 0.7);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -8px rgba(255, 54, 99, 0.8);
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line);
}
.btn.ghost:hover {
  box-shadow: inset 0 0 0 2px var(--pink);
  transform: none;
}
.btn[disabled] {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.oauth-row {
  display: flex;
  gap: 10px;
  margin: 18px 0 4px;
  flex-wrap: wrap;
}
.oauth-row .btn {
  flex: 1;
  white-space: nowrap;
}

.or {
  text-align: center;
  color: var(--soft);
  font-size: 12px;
  letter-spacing: 0.24em;
  margin: 16px 0 0;
}

/* The plan card's states. */
.plan-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.plan-name {
  font-size: 26px;
  font-weight: 800;
}
.pill {
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.pill.good {
  color: var(--good);
  background: rgba(29, 158, 80, 0.1);
  border: 1px solid rgba(29, 158, 80, 0.35);
}
.pill.warn {
  color: var(--pink);
  background: rgba(255, 54, 99, 0.08);
  border: 1px solid rgba(255, 54, 99, 0.35);
}

/* The installations list: a grid, so every status pill and every device
   count sits in its own column, aligned down the card. */
.room {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 88px 150px;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.room:first-of-type {
  border-top: 0;
  padding-top: 4px;
}
.room a {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.room a:hover {
  color: var(--pink);
}
.room .pill {
  justify-self: start;
  text-align: center;
  min-width: 68px;
}
.room .devices {
  color: var(--soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  justify-self: end;
}
.btn.tiny {
  padding: 4px 12px;
  font-size: 13px;
}

/* The QR veil: one code, over everything, gone on a click. */
.qr-veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(43, 43, 51, 0.5);
  cursor: pointer;
}
.qr-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  max-width: min(92vw, 380px);
}
.qr-card h3 {
  margin: 0 0 10px;
  font-size: 17px;
}
.qr-box img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}
.qr-card .small {
  overflow-wrap: anywhere;
}

.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--wash);
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 8px 0 4px;
}
.meter > div {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}

footer {
  text-align: center;
  padding: 18px;
  color: var(--soft);
  font-size: 13px;
}
a {
  color: var(--pink);
}

@media (max-width: 480px) {
  .row {
    flex-direction: column;
  }
  .oauth-row .btn {
    flex-basis: 100%;
  }
  .room {
    grid-template-columns: minmax(0, 1fr) auto 88px;
  }
  .room .devices {
    grid-column: 1 / -1;
    justify-self: start;
  }
}
