/* Business login and the signed-in pages, on top of styles.css. */

.auth-page { background: var(--surface); }

nav button.nav-cta { border: 0; cursor: pointer; font: inherit; font-weight: 700; }
/* Stays white on its own page, where it is also the current page */
nav .nav-cta[aria-current="page"] { color: var(--accent-text); }

/* Login: a blue panel beside the form */

.auth-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 20px 64px;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 32px;
  align-items: start;
}

.auth-side {
  position: sticky;
  top: 96px;
  background: linear-gradient(135deg, var(--band-from), var(--band-to));
  color: #fff;
  border-radius: 24px;
  padding: 40px 34px;
}

.auth-side-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.auth-side h1 { color: #fff; font-size: clamp(28px, 3.4vw, 38px); margin: 0 0 12px; }
.auth-side p { color: #e1e5ff; margin: 0 0 20px; font-size: 17px; }
.auth-side ul { list-style: none; padding: 0; margin: 0; }
/* The tick sits in line with the middle of its text */
.auth-side li { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.auth-side li::before {
  content: "✓";
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.auth-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 32px 32px;
  box-shadow: 0 18px 40px rgba(25, 33, 59, 0.06);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
}

.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-text); }

.view h2 { font-size: 26px; margin: 4px 0 4px; }
.view h2::before { display: none; }
.view .sub { color: var(--muted); margin: 0 0 22px; }
.view h3 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 26px 0 10px; }

.field { display: block; margin: 0 0 16px; }
.field > span:first-child { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }

.field input,
.field select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  outline: none;
}

.field input:focus,
.field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field [aria-invalid="true"] { border-color: #c54b53; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.password, .phone { display: flex; position: relative; }
.password input { padding-right: 64px; }
.show-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 8px;
  cursor: pointer;
}

.phone .dial {
  display: grid;
  place-items: center;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: var(--surface);
  font-weight: 700;
}
.phone input { border-radius: 0 12px 12px 0; }

.hint { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }
.error { display: block; color: #c54b53; font-size: 13px; font-weight: 600; margin-top: 5px; }
.error:empty { display: none; }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 4px; font-size: 15px; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }

.right { text-align: right; margin: -6px 0 16px; font-size: 14px; }

button.primary {
  width: 100%;
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 17px;
  padding: 13px 18px;
  cursor: pointer;
}
button.primary:disabled { opacity: 0.7; cursor: progress; }

.fine { color: var(--muted); font-size: 13px; text-align: center; margin: 14px 0 0; }
.switch { text-align: center; margin: 18px 0 0; font-weight: 600; }

/* Messages at the top of the card */

.notice {
  border-radius: 14px;
  padding: 14px 16px;
  margin: 0 0 20px;
  font-size: 15px;
}
.notice b { display: block; margin-bottom: 2px; }
.notice button {
  display: block;
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  padding: 0;
  cursor: pointer;
}
.notice.error { background: #fbedee; color: #8f2f36; }
.notice.warning { background: #fff5df; color: #7a4f0c; }
.notice.success { background: var(--green-soft); color: #0b6b2c; }

@media (prefers-color-scheme: dark) {
  .notice.error { background: #3a1c20; color: #ffb4ba; }
  .notice.warning { background: #3a2c10; color: #ffd98a; }
  .notice.success { color: #8ee0a9; }
}

/* The signed-in web app: a side menu on laptops, a bottom bar on phones */

.app-page { background: var(--surface); }

.app-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.app-help { color: var(--muted); font-weight: 600; text-decoration: none; }

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  padding: 24px 24px 64px;
}

.app-nav { position: sticky; top: 88px; align-self: start; display: flex; flex-direction: column; gap: 4px; }
.app-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.app-nav a:hover { background: var(--bg); color: var(--text); }
.app-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-ico { display: inline-grid; }

.ico { width: 20px; height: 20px; flex: none; }
.ico.big { width: 28px; height: 28px; }

.app-main { min-width: 0; width: 100%; max-width: 760px; }
.app-main h1 { font-size: clamp(26px, 3.4vw, 32px); margin: 0 0 6px; }
.app-main .sub { color: var(--muted); margin: 0 0 22px; }
.eyebrow-line { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; margin: 0 0 4px; }
.loading { color: var(--muted); }

.section-title { font-size: 16px; margin: 28px 0 10px; }
.section-title::before { display: none; }

/* Home */

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tile b { font-size: 28px; line-height: 1.2; display: flex; align-items: center; gap: 8px; }
.tile span { color: var(--muted); font-size: 14px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); display: inline-block; }

.credits-card {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--green);
  color: #fff;
  border-radius: 16px;
  padding: 18px 20px;
}
.credits-card.low { background: #e53935; }
.credits-card b { display: block; font-size: 21px; }
.credits-card span { opacity: 0.92; font-size: 14px; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.action {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}
.action .ico { color: var(--accent); width: 26px; height: 26px; }
a.action:hover { border-color: var(--accent); }
.action.disabled { opacity: 0.6; cursor: default; }
.action small { color: var(--muted); font-weight: 600; font-size: 12px; }

.plan-card {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
}
.plan-card b { display: block; }
.plan-card span { display: block; color: var(--muted); font-size: 14px; }
.plan-card .note { margin-top: 6px; color: var(--text); }
.badge { background: var(--green-soft); color: var(--green); font-weight: 800; font-size: 13px; padding: 4px 12px; border-radius: 999px; }

/* Account */

.profile-card { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 20px 22px; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.profile-head > div { flex: 1; min-width: 0; }
.profile-head b { display: block; font-size: 18px; }
.profile-head small { color: var(--muted); }
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
}
.btn-outline {
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.details { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.details dt { color: var(--muted); font-weight: 600; }
.details dd { margin: 0; overflow-wrap: anywhere; }


.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; text-decoration: none; margin-bottom: 10px; }

.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 26px;
}
.panel h2 { margin-top: 0; font-size: 19px; }
.panel h2::before { display: none; }
.panel.soon { background: var(--accent-soft); border-color: transparent; text-align: center; }
.panel.soon .ico { color: var(--accent); }
.form .primary { margin-top: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field input:disabled { background: var(--surface); color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  z-index: 30;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

dialog.confirm {
  border: 0;
  border-radius: 20px;
  padding: 24px;
  width: min(420px, calc(100vw - 32px));
  background: var(--bg);
  color: var(--text);
}
dialog.confirm::backdrop { background: rgba(10, 14, 30, 0.45); }
dialog.confirm h2 { margin: 0 0 8px; font-size: 20px; }
dialog.confirm h2::before { display: none; }
dialog.confirm p { color: var(--muted); margin: 0 0 20px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn-quiet, .btn-solid { border: 0; border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 700; cursor: pointer; }
.btn-quiet { background: var(--surface); color: var(--text); }
.btn-solid { background: var(--accent); color: var(--accent-text); }

@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; padding: 18px 16px 96px; }
  .app-top { padding: 10px 16px; }
  /* The menu becomes a bottom bar, as in the phone app */
  .app-nav {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    z-index: 20;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--border);
  }
  .app-nav a { flex-direction: column; gap: 3px; padding: 6px 10px; font-size: 12px; }
  .app-nav a[aria-current="page"] { background: transparent; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { position: static; padding: 28px 24px; }
  .auth-side ul { display: none; }
}

@media (max-width: 520px) {
  .auth-card { padding: 22px 18px 26px; border-radius: 20px; }
  .row { grid-template-columns: 1fr; gap: 0; }
}

/* Displays */

.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  text-decoration: none;
}
.btn-add .ico { width: 18px; height: 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip {
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.device-list { display: flex; flex-direction: column; gap: 10px; }
.device-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  text-decoration: none;
}
.device-card:hover { border-color: var(--accent); }
.device-ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--surface);
  color: var(--muted);
}
.device-ico.on { background: var(--green-soft); color: var(--green); }
.device-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.device-text small { color: var(--muted); }
.device-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.device-top b { font-size: 16px; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.status i { width: 7px; height: 7px; border-radius: 50%; }
.status.on { background: var(--green-soft); color: var(--green); }
.status.on i { background: var(--green); }
.status.off { background: var(--surface); color: var(--muted); }
.status.off i { background: var(--muted); }

.panel + .panel, .panel + .rows, .details.wide + .rows, .panel + .details.wide { margin-top: 14px; }
.panel.empty { text-align: center; padding: 34px 24px; }
.panel.empty .ico { color: var(--accent); }
.panel.empty p { color: var(--muted); }
.details.wide { border-radius: 20px; }

.steps-list { list-style: none; counter-reset: step; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 10px; }
.steps-list li {
  counter-increment: step;
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px 12px 54px;
}
.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
}
.steps-list b { display: block; }
.steps-list span { color: var(--muted); font-size: 14px; }

.code-input { font-size: 26px !important; font-weight: 800; letter-spacing: 0.18em; text-align: center; font-variant-numeric: tabular-nums; }

.notice.info { background: var(--accent-soft); color: var(--text); margin: 6px 0 4px; }

.success-panel { text-align: center; padding: 36px 26px; }
.success-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; display: inline-grid; place-items: center; margin-bottom: 10px; }
.success-panel h1 { margin-bottom: 8px; }
.button-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.button-col { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.btn-outline.wide { text-align: center; padding: 12px 16px; }
button.primary.danger-btn { background: #c54b53; }

@media (max-width: 760px) {
  .page-head { flex-direction: column; gap: 4px; }
  .btn-add { margin-bottom: 14px; }
}

.panel + .notice { margin-top: 14px; }

/* My Library */

.upload-btn { cursor: pointer; }
.link-btn { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; padding: 4px 6px; }
.center { text-align: center; }
.break { overflow-wrap: anywhere; }

.storage { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; margin: 12px 0 16px; }
.storage-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.storage-top span { color: var(--muted); }
/* A progress meter (storage used, upload progress); not .bar, which is the site header and footer */
.meter { display: block; height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.meter.thin { height: 5px; margin-top: 6px; }

.uploads { background: var(--bg); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; margin-bottom: 16px; }
.uploads-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.up-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.up-row:first-of-type { border-top: 0; }
.up-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.up-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.up-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.up-text small { color: var(--muted); }
.up-row.failed small, .up-row.cancelled small { color: #c54b53; }
.up-done { color: var(--green); }

.lib-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lib-tools .chips { margin: 0; }
.select-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 8px 12px;
  margin: 12px 0 0;
}
.select-bar span { flex: 1; font-weight: 700; }
.btn-danger { border: 0; border-radius: 999px; background: #c54b53; color: #fff; font: inherit; font-weight: 700; padding: 8px 16px; cursor: pointer; }
.btn-danger:disabled { opacity: 0.5; cursor: default; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.tile-media { display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; min-width: 0; }
.thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-media:hover .thumb { border-color: var(--accent); }
.tile-media.selected .thumb { outline: 3px solid var(--accent); outline-offset: -3px; }
.no-thumb { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.vid, .state-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(10, 14, 30, 0.7);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.state-badge { left: auto; right: 8px; top: 8px; bottom: auto; background: #a66b12; }
.tile-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(10, 14, 30, 0.35);
  display: grid;
  place-items: center;
  color: #fff;
}
.tile-check.on { background: var(--accent); border-color: var(--accent); }
.tile-check .ico { width: 14px; height: 14px; }
.tile-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { text-align: center; margin: 18px 0 6px; }

.preview { background: #0b1020; border-radius: 18px; overflow: hidden; display: grid; place-items: center; min-height: 160px; }
.preview img, .preview video { max-width: 100%; max-height: 70vh; display: block; }
.preview .muted { color: #a9b3c6; padding: 30px; }
.preview + .details { margin-top: 14px; }
.details.wide + .form, .form + .rows { margin-top: 14px; }
