/* Zetag customer and administrative portals.
   Same visual language as the Zetag panel (Enhance) and the plans page
   (website/landing): near-black background, #1b1b1b cards, #262626 dividers,
   light-weight headings, uppercase table labels, brand purple for actions. */

:root {
  --bg: #060606;
  --surface: #1b1b1b;
  --surface-hover: #232323;
  --surface-active: #2c2c2c;
  --input-bg: #101010;
  --line: #262626;
  --line-strong: #3a3a3a;
  --text: #ececec;
  --text-soft: #c4c4c4;
  --muted: #8e8e8e;
  --purple: #682aa0;
  --purple-hover: #7a34bb;
  --purple-light: #9569bc;
  --link: #c19ae8;
  --green: #1bb341;
  --ok-bg: #16351f;
  --ok-text: #9be3b0;
  --error: #ff7b88;
  --error-bg: #3a1419;
  --error-line: #a3303d;
  --max-width: 980px;

  color-scheme: dark;
  font-family: "Open Sans", "Segoe UI", "Noto Sans", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
}

a { color: var(--link); text-underline-offset: 0.2em; }
a:hover { color: #fff; }

:focus-visible { outline: 2px solid var(--purple-light); outline-offset: 2px; }

code {
  padding: 0.05rem 0.35rem;
  border-radius: 2px;
  background: var(--surface-active);
  color: var(--text);
  font-size: 0.88em;
}

.container { width: min(100% - 2rem, var(--max-width)); margin-inline: auto; }

/* ------------------------------------------------------------ header */

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  padding-block: 0.6rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--text);
  text-decoration: none;
}

.brand img { display: block; width: 120px; height: 36px; }

.brand span {
  padding-left: 0.9rem;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.9rem;
}

.nav { display: flex; align-items: center; gap: 1.25rem; }
.nav a { color: var(--text-soft); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; }
.nav-user {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline { display: inline; margin: 0; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.link-button:hover { color: #fff; }

/* -------------------------------------------------------------- page */

.main { flex: 1; padding-block: 2.5rem 3rem; }

.site-footer {
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer a { color: var(--text-soft); }

h1, h2, h3 { font-weight: 300; line-height: 1.2; }
h1 { margin: 0 0 1.5rem; font-size: 2rem; }
h2 { margin: 0 0 1rem; font-size: 1.4rem; }
h1 strong, h2 strong { font-weight: 700; }

.breadcrumb { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.9rem; }
.breadcrumb a { color: var(--text-soft); text-decoration: none; }
.breadcrumb a:hover { color: #fff; }

.card {
  margin-bottom: 1.25rem;
  padding: 1.5rem;
  background: var(--surface);
  border-left: 2px solid transparent;
}

.card.warn { border-left-color: var(--error-line); }

.narrow { max-width: 440px; margin-inline: auto; }

.muted { color: var(--muted); }
.small-text { font-size: 0.85rem; }
.danger { color: var(--error); }
.spaced { margin-top: 2rem; }
.spaced-small { margin-top: 0.9rem; }
.links { margin-top: 1.25rem; font-size: 0.92rem; }
.list { margin: 0; padding-left: 1.2rem; }
.list li + li { margin-top: 0.35rem; }

.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;
}

/* ------------------------------------------------------------- forms */

.form { display: grid; gap: 0.45rem; }

.form label {
  margin-top: 0.6rem;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
}

.form input:not([type="checkbox"]):not([type="hidden"]),
.table input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.form input::placeholder, .table input::placeholder { color: #6c6c6c; }

.form input:focus, .table input:focus {
  outline: none;
  border-color: var(--purple-light);
  box-shadow: 0 0 0 1px var(--purple-light);
}

input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--purple); }

.form-inline { grid-template-columns: 1fr auto; align-items: center; }
.form-inline .button { margin-top: 0; }

/* ----------------------------------------------------------- buttons */

.button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.7rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 2px;
  background: var(--purple);
  color: #fff;
  font: inherit;
  font-weight: 400;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.button:hover { background: var(--purple-hover); color: #fff; }

.button.small {
  margin-top: 0;
  padding: 0.4rem 0.95rem;
  font-size: 0.88rem;
}

.button.secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
}

.button.secondary:hover { background: var(--surface-active); }

.button.danger-outline, .danger-outline { border-color: var(--error-line); color: var(--error); }
.button.danger-outline:hover { background: var(--error-bg); }

.button.danger-fill { background: #a3303d; }
.button.danger-fill:hover { background: #bb3a48; }

.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ------------------------------------------------------------ alerts */

.alert {
  max-width: 440px;
  margin: 0 auto 1.25rem;
  padding: 0.8rem 1rem;
  border-left: 2px solid;
}

.alert-ok { background: var(--ok-bg); border-color: var(--green); color: var(--ok-text); }
.alert-error { background: var(--error-bg); border-color: var(--error-line); color: #ffc2c9; }

/* ------------------------------------------------------------ tables */

.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }

.table th, .table td {
  padding: 0.85rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.table th {
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.table td { color: var(--text-soft); }
.table tbody tr:hover { background: var(--surface-hover); }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table a { color: #fff; text-decoration: none; }
.table a:hover { text-decoration: underline; }

/* ----------------------------------------------------- facts, tabs, grid */

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0;
  margin: 0;
}

.facts dt, .facts dd { padding: 0.65rem 0; border-bottom: 1px solid var(--line); }

.facts dt {
  padding-right: 2rem;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.facts dd { margin: 0; color: var(--text); }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.tabs a {
  padding: 0.6rem 1rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
}

.tabs a:hover { color: #fff; }
.tabs a[aria-current="page"] { border-bottom-color: var(--purple-light); color: #fff; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.grid .card { margin-bottom: 0; }

.plan { border-left-color: var(--green); }
.plan h2 { margin-bottom: 0.25rem; }
.plan .price { margin: 0.5rem 0 0; font-size: 1.8rem; font-weight: 300; }
.plan .price span { color: var(--muted); font-size: 0.9rem; }

.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stats .card { border-left-color: var(--green); }
.stats .card.warn { border-left-color: var(--error-line); }
.stat { margin: 0 0 0.25rem; font-size: 2.2rem; font-weight: 300; line-height: 1.1; }
.stat a { color: inherit; text-decoration: none; }

.subscription-block + .subscription-block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-strong);
}

.hello { font-size: 2.1rem; }

/* Plan chosen on the public plans page (/assinar). */
.plan.selected { border-left-color: var(--purple-light); box-shadow: inset 0 0 0 1px var(--purple-light); }
.chosen-tag {
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0.1rem 0.55rem;
  border-radius: 2px;
  background: var(--purple);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}
.table tr.selected td { background: #241a30; color: #fff; }
.table tr.selected td:first-child { box-shadow: inset 2px 0 0 var(--purple-light); }
.alert.choice { max-width: none; margin-inline: 0; }

/* ------------------------------------------- administrative portal */

.admin .main.wide { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: 2rem; }

.has-sidebar { flex-direction: row; }

.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 220px;
  height: 100vh;
  padding: 1.25rem 0;
  background: var(--surface);
  overflow-y: auto;
}

.sidebar-logo { display: block; padding: 0 1rem 0.5rem; }
.sidebar-logo img, .content-top-guest img { display: block; width: 120px; height: 36px; }

.sidebar-label {
  margin: 0.25rem 0 1.25rem;
  padding: 0 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.sidebar-nav { display: flex; flex-direction: column; }

.sidebar-nav a {
  padding: 0.8rem 1rem;
  border-left: 3px solid transparent;
  color: var(--text-soft);
  text-decoration: none;
}

.sidebar-nav a:hover { background: var(--surface-hover); color: #fff; }

.sidebar-nav a[aria-current="page"] {
  border-left-color: var(--purple-light);
  background: var(--surface-active);
  color: #fff;
}

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.content-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.25rem;
  min-height: 3.5rem;
  padding: 0.5rem 2rem;
  border-bottom: 1px solid var(--line);
}

.content-top-guest { justify-content: flex-start; background: var(--surface); }
.content-top-guest .sidebar-label { margin: 0; padding-left: 0.9rem; border-left: 1px solid var(--line-strong); }

/* ------------------------------------------------------------ mobile */

@media (max-width: 760px) {
  .has-sidebar { flex-direction: column; }

  .sidebar {
    position: static;
    flex: none;
    height: auto;
    padding: 0.75rem 0 0;
  }

  .sidebar-label { margin-bottom: 0.5rem; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }

  .sidebar-nav a { padding: 0.6rem 0.9rem; border-left: 0; border-bottom: 2px solid transparent; }
  .sidebar-nav a[aria-current="page"] { border-bottom-color: var(--purple-light); }

  .content-top { padding-inline: 1rem; }
  .admin .main.wide { padding-inline: 1rem; }
}

@media (max-width: 640px) {
  .table { display: block; overflow-x: auto; }
  .form-inline { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { padding-bottom: 0; border-bottom: 0; }
  .brand span { display: none; }
  h1 { font-size: 1.7rem; }
}
