:root {
  color-scheme: light;
  --ink: #172025;
  --ink-soft: #34444d;
  --muted: #6b7a84;
  --line: #d5dce0;
  --line-strong: #aab7be;
  --panel: #ffffff;
  --panel-warm: #fbf9f4;
  --page: #eef2ef;
  --field: #f9fbfa;
  --accent: #05796f;
  --accent-strong: #075f59;
  --accent-soft: #dff3ef;
  --amber: #b36b18;
  --red: #a93226;
  --graphite: #263238;
  --shadow: 0 22px 60px rgba(23, 32, 37, 0.12);
  --shadow-soft: 0 14px 34px rgba(23, 32, 37, 0.08);
}

* {
  box-sizing: border-box;
}

::selection {
  background: rgba(5, 121, 111, 0.18);
  color: var(--ink);
}

input,
textarea,
select {
  caret-color: var(--accent);
}

html {
  min-height: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(90deg, rgba(5, 121, 111, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(5, 121, 111, 0.05) 1px, transparent 1px),
    linear-gradient(118deg, transparent 0 62%, rgba(179, 107, 24, 0.11) 62% 70%, transparent 70%),
    linear-gradient(135deg, #fbfcf9 0%, var(--page) 48%, #e6ece8 100%);
  background-size: 32px 32px, 32px 32px, auto, auto;
  color: var(--ink);
  font-family: Aptos, "Avenir Next", "Segoe UI", sans-serif;
}

body::before {
  background: linear-gradient(90deg, var(--graphite), var(--accent), var(--amber));
  content: "";
  display: block;
  height: 6px;
  width: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  body > main {
    animation: pageReveal 380ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
}

@keyframes pageReveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.shell {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 46px;
}

.shell.compact {
  max-width: 860px;
}

.app-frame {
  position: relative;
}

.hero {
  align-items: stretch;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  margin-bottom: 18px;
}

.hero-copy,
.download-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(213, 220, 224, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.hero-copy {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 178px;
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.hero-copy::after {
  background:
    linear-gradient(135deg, rgba(5, 121, 111, 0.14), transparent 56%),
    repeating-linear-gradient(90deg, rgba(23, 32, 37, 0.08) 0 1px, transparent 1px 13px);
  content: "";
  height: 100%;
  opacity: 0.62;
  position: absolute;
  right: 0;
  top: 0;
  width: 34%;
}

.brand-lockup {
  align-items: center;
  background: linear-gradient(145deg, #ffffff, #f2f6f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  height: 130px;
  justify-items: center;
  padding: 14px;
  position: relative;
  text-decoration: none;
  width: 130px;
  z-index: 1;
}

.brand-logo {
  height: 76px;
  object-fit: contain;
  width: 76px;
}

.title-block {
  min-width: 0;
  position: relative;
  z-index: 1;
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  font-family: "Iowan Old Style", "Sitka Display", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  font-size: 46px;
  letter-spacing: -0.01em;
  line-height: 1.02;
  max-width: 760px;
}

h2 {
  font-size: 22px;
  letter-spacing: -0.005em;
  line-height: 1.12;
}

/* Marketing/hero h1 on the landing page only — the only place a big serif still pays. */
.hero h1 {
  font-size: 60px;
  letter-spacing: -0.015em;
  line-height: 0.96;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.2;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 12px;
  max-width: 660px;
}

.download-card {
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.98) 0%, rgba(223, 243, 239, 0.85) 100%);
  border-color: rgba(5, 121, 111, 0.22);
  display: grid;
  gap: 18px;
  grid-template-rows: 1fr auto;
  min-height: 178px;
  overflow: hidden;
  padding: 24px 24px 22px 28px;
  position: relative;
}

.download-card::before {
  background: linear-gradient(180deg, var(--accent), var(--amber));
  content: "";
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 4px;
}

.download-card h2 {
  font-size: 26px;
  line-height: 1.04;
  margin-top: 4px;
}

.download-note {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
  margin-top: 10px;
  max-width: 320px;
}

.download-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 16px 28px rgba(5, 121, 111, 0.28);
  font-size: 16px;
  gap: 12px;
  min-height: 56px;
  padding: 0 22px;
  width: 100%;
}

.download-primary:hover {
  background: linear-gradient(135deg, var(--accent-strong), #054b46);
}

.download-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  display: inline-flex;
  font-size: 16px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.download-actions {
  display: grid;
  gap: 10px;
}

.account-portal-link {
  min-height: 46px;
  width: 100%;
}

.plans-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(251, 249, 244, 0.92));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 18px;
  margin-top: 18px;
  padding: 24px;
}

.plans-notice {
  background: var(--accent-soft);
  border: 1px solid #aadcd2;
  border-radius: 8px;
  color: var(--accent-strong);
  font-weight: 850;
  padding: 16px 18px;
}

.plans-notice p:last-child {
  color: var(--ink-soft);
  font-weight: 750;
  line-height: 1.45;
}

.plans {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 250, 0.98));
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  overflow: hidden;
  padding: 22px;
  position: relative;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.plan-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-3px);
}

.plan-card-featured:hover {
  border-color: var(--accent);
}

.plan-card-featured {
  border-color: rgba(5, 121, 111, 0.74);
  box-shadow: inset 0 0 0 1px rgba(5, 121, 111, 0.18), 0 18px 40px rgba(5, 121, 111, 0.12);
}

.plan-card-featured::before {
  background: linear-gradient(90deg, var(--accent), var(--amber));
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.plan-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 42px;
}

.plan-header h2 {
  font-size: 24px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  padding: 6px 9px;
  white-space: nowrap;
}

.status-ready {
  background: var(--accent-soft);
  border-color: #aadcd2;
  color: var(--accent-strong);
}

.status-disabled {
  background: #eff2f3;
  color: #65747c;
}

.status-savings {
  background: linear-gradient(135deg, #fff5e1, #ffe7bd);
  border-color: #e6c486;
  color: var(--amber);
}

.quota {
  font-family: "Iowan Old Style", "Sitka Display", Georgia, serif;
  font-size: 62px;
  font-weight: 800;
  line-height: 0.9;
  margin-top: 4px;
}

.quota-label,
.plan-price {
  color: var(--muted);
  font-weight: 850;
}

.quota-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-price {
  font-size: 15px;
  margin-top: auto;
}

.plan-skel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 250, 0.98));
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  padding: 22px;
}

.plan-skel .skel-line {
  animation: skelShimmer 1.4s ease-in-out infinite;
  background: linear-gradient(90deg, #eaefee 0%, #f5f8f7 50%, #eaefee 100%);
  background-size: 200% 100%;
  border-radius: 6px;
  height: 14px;
}

.plan-skel .skel-num {
  height: 50px;
  margin: 4px 0;
  width: 58%;
}

.plan-skel .skel-short {
  width: 40%;
}

.plan-skel .skel-btn {
  height: 46px;
  margin-top: 10px;
}

@keyframes skelShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .plan-skel .skel-line {
    animation: none;
  }
}

.download,
.secondary,
button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.download,
button {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(5, 121, 111, 0.23);
}

.download:hover,
button:hover {
  background: var(--accent-strong);
  box-shadow: 0 18px 30px rgba(5, 121, 111, 0.28);
  transform: translateY(-1px);
}

.download:active,
button:active {
  box-shadow: 0 6px 14px rgba(5, 121, 111, 0.22);
  transform: translateY(0);
}

.secondary {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
  box-shadow: none;
  color: var(--ink);
}

.secondary:hover {
  background: #ffffff;
  border-color: var(--line-strong);
  color: var(--accent-strong);
}

.secondary:active {
  transform: translateY(0);
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  width: 100%;
}

button:disabled {
  background: #87949b;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.hidden {
  display: none !important;
}

label {
  color: var(--ink-soft);
  display: grid;
  font-size: 13px;
  font-weight: 850;
  gap: 8px;
}

input,
select {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 46px;
  padding: 0 13px;
  width: 100%;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  padding-right: 34px;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(5, 121, 111, 0.16);
  outline: none;
}

.empty-state {
  background:
    radial-gradient(280px 120px at 50% 0%, rgba(5, 121, 111, 0.05), transparent 70%),
    var(--panel-warm);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  grid-column: 1 / -1;
  line-height: 1.55;
  padding: 40px 24px;
  text-align: center;
}

.admin-page {
  background:
    linear-gradient(90deg, rgba(38, 50, 56, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(5, 121, 111, 0.05) 1px, transparent 1px),
    linear-gradient(135deg, #f8faf7 0%, #eef2ef 52%, #e8ede9 100%);
  background-size: 28px 28px, 28px 28px, auto;
}

.admin-shell {
  display: grid;
  gap: 18px;
}

.admin-topbar {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 12px;
  padding: 13px 15px;
}

.admin-bar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.admin-brand {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 11px;
  text-decoration: none;
}

.admin-brand-logo {
  align-items: center;
  background: linear-gradient(145deg, #ffffff, #eef3f1);
  border: 1px solid var(--line);
  border-radius: 9px;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.admin-brand-logo img {
  height: 27px;
  object-fit: contain;
  width: 27px;
}

.admin-brand-text {
  color: var(--muted);
  display: flex;
  flex-direction: column;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.admin-brand-text strong {
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.03em;
}

.admin-pagehead h1 {
  font-size: 32px;
  line-height: 1.06;
}

.admin-pagehead .muted {
  margin-top: 6px;
}

.admin-logout {
  background: transparent;
  box-shadow: none;
  min-width: 104px;
  width: auto;
}

.admin-actions-row,
.admin-danger-row {
  display: flex;
  gap: 10px;
}

.admin-nav {
  background: #eef2f0;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 4px;
}

.admin-nav a {
  align-items: center;
  border-radius: 6px;
  color: var(--ink-soft);
  display: inline-flex;
  flex: 1;
  font-size: 13px;
  font-weight: 850;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent-strong);
}

.admin-nav a.is-active {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(23, 32, 37, 0.14);
  color: var(--accent-strong);
}

.admin-actions-row {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-actions-row .secondary,
.admin-panel-head .secondary {
  min-height: 38px;
  padding: 0 12px;
}

.admin-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-top: 16px;
}

.admin-stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-stat,
.admin-panel {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.admin-stat {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 18px;
}

.admin-stat p,
.admin-stat span,
.admin-table span,
.admin-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-stat strong {
  color: var(--ink);
  font-family: "Iowan Old Style", "Sitka Display", Georgia, serif;
  font-size: 44px;
  line-height: 0.95;
}

.admin-panel {
  overflow: hidden;
  padding: 20px;
}

.admin-panel-head {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-search {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 380px) 112px;
  margin-bottom: 18px;
}

.admin-search button {
  min-height: 46px;
}

.admin-form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-form-grid button {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 190px;
  width: auto;
}

.admin-form-divider,
.customer-form-divider {
  border-top: 1px solid var(--line);
}

.admin-form-divider {
  margin: 18px 0;
}

.admin-checkbox {
  align-items: center;
  align-self: end;
  flex-direction: row;
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  gap: 8px;
  min-height: 46px;
}

.admin-plan-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}

.admin-plan-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.admin-plan-card-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 0;
}

.admin-plan-delete {
  flex-shrink: 0;
}

.admin-plan-delete button {
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
  height: 30px;
  min-height: 0;
  padding: 0 12px;
  width: auto;
}

.admin-plan-delete button:hover {
  background: #fff7f5;
  border-color: #f5b8b2;
  color: var(--red);
  transform: none;
}

.admin-plan-card .admin-hint {
  margin-top: 4px;
}

.admin-checkbox input {
  height: 18px;
  min-height: 0;
  width: 18px;
}

.admin-danger-row {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.admin-danger-row form {
  min-width: 160px;
}

.admin-danger-row .secondary {
  background: #fff7f5;
  border-color: #f5b8b2;
  color: var(--red);
}

.admin-danger-row .secondary:hover {
  background: #fdecea;
  border-color: #e79b93;
  color: var(--red);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

.admin-table-compact {
  min-width: 520px;
}

.admin-table th {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 0 10px 10px;
  text-align: left;
  text-transform: uppercase;
}

.admin-table td {
  border-bottom: 1px solid rgba(213, 220, 224, 0.72);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 750;
  padding: 13px 10px;
  vertical-align: middle;
}

.admin-table td:first-child,
.admin-table td:nth-child(2) {
  color: var(--ink);
}

.admin-table a,
.admin-link {
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.admin-table span {
  display: block;
  letter-spacing: 0;
  margin-top: 4px;
  text-transform: none;
}

.admin-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  justify-content: center;
  min-width: 78px;
  padding: 6px 11px;
  text-align: center;
  white-space: nowrap;
}

.admin-badge.is-good {
  background: var(--accent-soft);
  border-color: #aadcd2;
  color: var(--accent-strong);
}

.admin-badge.is-bad {
  background: #fdecea;
  border-color: #f5b8b2;
  color: var(--red);
}

.admin-badge.is-warn {
  background: #fff2df;
  border-color: #edc98f;
  color: var(--amber);
}

.admin-badge.is-muted {
  background: #eff2f3;
  color: #65747c;
}

.admin-detail-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.admin-quota-meter {
  background: #e1e7e8;
  border-radius: 999px;
  height: 10px;
  margin: 18px 0 8px;
  overflow: hidden;
}

.admin-quota-meter span {
  background: linear-gradient(90deg, var(--accent), var(--amber));
  display: block;
  height: 100%;
}

.admin-facts {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0 0;
}

.admin-facts div {
  border-top: 1px solid var(--line);
  min-width: 0;
  padding-top: 10px;
}

.admin-facts dd {
  color: var(--ink);
  font-weight: 850;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.admin-checks {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-check {
  align-items: center;
  background: rgba(249, 251, 250, 0.85);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 12px 14px;
}

.admin-check-name {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.admin-check-value {
  color: var(--ink-soft);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
  text-align: right;
}

.admin-health-error {
  background: #fdecea;
  border: 1px solid #f5b8b2;
  border-left: 3px solid var(--red);
  border-radius: 8px;
  margin-top: 12px;
  padding: 12px 14px;
}

.admin-health-error-head {
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.01em;
  margin: 0;
  text-transform: uppercase;
}

.admin-health-error-body {
  color: var(--ink-soft);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.admin-alert {
  background: #fdecea;
  border: 1px solid #f5b8b2;
  border-radius: 8px;
  color: var(--red);
  font-weight: 850;
  padding: 12px 14px;
  text-align: center;
}

.admin-notice {
  background: var(--accent-soft);
  border: 1px solid #aadcd2;
  border-radius: 8px;
  color: var(--accent-strong);
  font-weight: 850;
  padding: 12px 14px;
  text-align: center;
}

.customer-page {
  background:
    linear-gradient(90deg, rgba(38, 50, 56, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(5, 121, 111, 0.05) 1px, transparent 1px),
    linear-gradient(135deg, #fbfcf9 0%, #eef2ef 52%, #e7ede9 100%);
  background-size: 30px 30px, 30px 30px, auto;
}

.customer-shell {
  display: grid;
  gap: 18px;
}

.customer-topbar,
.customer-panel {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.customer-topbar h1 {
  font-size: 34px;
  letter-spacing: -0.01em;
  line-height: 1.05;
}


/* Customer auth — login / register / password recovery */
.auth-page {
  background:
    radial-gradient(820px 460px at 12% -8%, rgba(5, 121, 111, 0.13), transparent 72%),
    radial-gradient(680px 420px at 100% 112%, rgba(179, 107, 24, 0.1), transparent 70%),
    linear-gradient(135deg, #fbfcf9 0%, #eef2ef 52%, #e7ede9 100%);
}

.auth-shell {
  align-content: center;
  display: grid;
  min-height: calc(100vh - 6px);
  padding: 44px 18px 52px;
}

.auth-split {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  margin: 0 auto;
  max-width: 940px;
  overflow: hidden;
  width: 100%;
}

.auth-brand {
  background:
    radial-gradient(130% 90% at 100% 0%, rgba(255, 255, 255, 0.16), transparent 58%),
    linear-gradient(158deg, var(--accent) 0%, var(--accent-strong) 56%, #04403c 100%);
  color: #e9faf5;
  display: flex;
  flex-direction: column;
  gap: 26px;
  overflow: hidden;
  padding: 40px 36px;
  position: relative;
}

.auth-brand::before {
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 30px 30px;
  content: "";
  inset: 0;
  -webkit-mask-image: linear-gradient(150deg, #000, transparent 78%);
  mask-image: linear-gradient(150deg, #000, transparent 78%);
  position: absolute;
}

.auth-brand > * {
  position: relative;
  z-index: 1;
}

.auth-brand.is-admin {
  background:
    radial-gradient(130% 90% at 100% 0%, rgba(5, 121, 111, 0.36), transparent 56%),
    linear-gradient(158deg, #33454c 0%, #1f2c31 56%, #131c1f 100%);
}

.auth-brand-top {
  align-items: center;
  display: flex;
  gap: 14px;
}

.auth-logo {
  align-items: center;
  background: #ffffff;
  border-radius: 13px;
  box-shadow: 0 10px 22px rgba(4, 64, 60, 0.34);
  display: inline-flex;
  flex: 0 0 auto;
  height: 56px;
  justify-content: center;
  width: 56px;
}

.auth-logo img {
  height: 38px;
  object-fit: contain;
  width: 38px;
}

.auth-wordmark {
  color: rgba(233, 250, 245, 0.74);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.auth-wordmark strong {
  color: #ffffff;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.auth-brand-copy {
  margin-top: auto;
}

.auth-brand-copy h2 {
  color: #ffffff;
  font-size: 29px;
  line-height: 1.12;
}

.auth-brand-copy p {
  color: rgba(233, 250, 245, 0.82);
  font-size: 14px;
  line-height: 1.55;
  margin-top: 12px;
}

.auth-points {
  display: grid;
  gap: 13px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.auth-points li {
  align-items: start;
  color: rgba(233, 250, 245, 0.92);
  display: grid;
  font-size: 13.5px;
  font-weight: 750;
  gap: 11px;
  grid-template-columns: 22px minmax(0, 1fr);
  line-height: 1.4;
}

.auth-point-mark {
  align-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 7px;
  color: #ffffff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.auth-form-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
  padding: 42px 40px;
}

.auth-head h1 {
  font-size: 33px;
  line-height: 1.04;
  margin-top: 4px;
}

.auth-head p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 10px;
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-field {
  position: relative;
}

.auth-label-row {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.auth-hint {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.auth-label-row a {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.auth-label-row a:hover {
  text-decoration: underline;
}

.auth-field-password input {
  padding-right: 88px;
}

.auth-reveal {
  background: rgba(5, 121, 111, 0.09);
  border: 1px solid rgba(5, 121, 111, 0.18);
  border-radius: 5px;
  bottom: 7px;
  box-shadow: none;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  height: 32px;
  min-height: 0;
  padding: 0 11px;
  position: absolute;
  right: 7px;
  width: auto;
}

.auth-reveal:hover {
  background: rgba(5, 121, 111, 0.16);
  transform: none;
}

.auth-submit {
  margin-top: 3px;
}

.auth-alt {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  padding-top: 18px;
  text-align: center;
}

.auth-alt a {
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.auth-alt a:hover {
  text-decoration: underline;
}

.auth-form-side .admin-alert,
.auth-form-side .admin-notice {
  margin: 0;
}

.auth-foot {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12.5px;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.auth-foot a {
  color: var(--muted);
  text-decoration: none;
}

.auth-foot a:hover {
  color: var(--accent-strong);
}

.auth-foot span[aria-hidden="true"] {
  color: var(--line-strong);
}

@media (max-width: 800px) {
  .auth-split {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .auth-brand {
    gap: 18px;
    padding: 30px 28px;
  }

  .auth-brand-copy h2 {
    font-size: 24px;
  }

  .auth-points {
    display: none;
  }

  .auth-form-side {
    padding: 30px 28px;
  }

  .auth-head h1 {
    font-size: 29px;
  }
}

.customer-topbar {
  align-items: center;
  display: flex;
  gap: 16px;
  padding: 18px 22px;
}

.customer-brand {
  align-items: center;
  background: linear-gradient(145deg, #ffffff, #eef3f1);
  border: 1px solid var(--line);
  border-radius: 11px;
  display: inline-flex;
  flex-shrink: 0;
  height: 50px;
  justify-content: center;
  transition: transform 160ms ease, box-shadow 160ms ease;
  width: 50px;
}

.customer-brand:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.customer-brand img {
  height: 32px;
  object-fit: contain;
  width: 32px;
}

.customer-topbar-title {
  flex: 1;
  min-width: 0;
}

.customer-logout {
  width: auto;
}

.customer-topbar-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.customer-settings-content {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  margin: 0 auto;
  max-width: 1080px;
  width: 100%;
}

.customer-settings-submit {
  justify-self: end;
  min-width: 200px;
  width: auto;
}

a.customer-settings-submit {
  align-items: center;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  padding: 0 18px;
  text-decoration: none;
}

.customer-danger-submit {
  background: #fff;
  border: 1px solid #e0bdb6;
  color: var(--red);
  font-weight: 700;
}

.customer-danger-submit:hover,
.customer-danger-submit:focus-visible {
  background: #fbeeec;
  border-color: var(--red);
  color: var(--red);
}

.customer-panel {
  padding: 20px;
}

.customer-panel-head {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.customer-form,
.customer-form form {
  display: grid;
  gap: 14px;
}

.customer-status-line {
  margin-top: 10px;
}

.customer-guide {
  background: rgba(223, 243, 239, 0.42);
  border: 1px solid rgba(5, 121, 111, 0.2);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.customer-guide div {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 26px minmax(0, 1fr);
}

.customer-guide strong {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.customer-guide span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.3;
}

.customer-account-panel .customer-form-divider {
  margin: 2px 0;
}

.customer-machine-list {
  display: grid;
  gap: 14px;
}

.customer-machine-card {
  background: rgba(249, 251, 250, 0.85);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 16px;
  padding: 18px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.customer-machine-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.customer-machine-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.customer-machine-head h3 {
  font-size: 22px;
  line-height: 1.05;
  margin: 0;
  overflow-wrap: anywhere;
}

.customer-machine-head p,
.customer-note,
.customer-quota-label,
.customer-back {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.customer-facts {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.customer-facts div {
  border-top: 1px solid var(--line);
  min-width: 0;
  padding-top: 10px;
}

.customer-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.customer-facts dd {
  color: var(--ink);
  font-weight: 850;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.customer-quota {
  background: #e1e7e8;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.customer-quota span {
  background: linear-gradient(90deg, var(--accent), var(--amber));
  display: block;
  height: 100%;
}

.customer-machine-actions {
  display: grid;
  gap: 12px;
}

.customer-machine-actions > form:not(.customer-plan-change) {
  max-width: 260px;
}

.customer-plan-change {
  background: rgba(223, 243, 239, 0.38);
  border: 1px solid rgba(5, 121, 111, 0.18);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.customer-plan-current {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  margin-bottom: 4px;
}

.customer-verification {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(179, 107, 24, 0.07), transparent 65%),
    var(--panel);
  border-left: 3px solid var(--amber);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px 22px;
}

.customer-verification .eyebrow {
  color: var(--amber);
}

.customer-verification h2 {
  font-size: 18px;
}

.customer-verification form {
  flex: 0 0 auto;
}

@media (max-width: 960px) {
  .hero,
  .plans,
  .admin-stats,
  .admin-detail-grid,
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: 0;
  }

  h1 {
    font-size: 54px;
  }

  .download {
    width: 100%;
  }

  .admin-bar,
  .admin-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-search {
    grid-template-columns: 1fr;
  }

  .admin-nav,
  .admin-actions-row,
  .admin-danger-row {
    justify-content: flex-start;
  }

  .admin-nav {
    flex-wrap: wrap;
  }

  .admin-logout {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 22px, 1160px);
    padding: 20px 0 32px;
  }

  .hero-copy {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .hero-copy::after {
    height: 42%;
    width: 100%;
  }

  .brand-lockup {
    height: 96px;
    width: 96px;
  }

  .brand-logo {
    height: 58px;
    width: 58px;
  }

  .download-card {
    padding: 18px;
  }

  h1 {
    font-size: 42px;
  }

  .admin-pagehead h1,
  .customer-topbar h1 {
    font-size: 26px;
  }

  .admin-panel {
    padding: 16px;
  }

  .admin-checks {
    grid-template-columns: 1fr;
  }

  .admin-facts {
    grid-template-columns: 1fr;
  }

  .customer-topbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .customer-topbar {
    flex-direction: column;
  }

  .customer-verification {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-facts {
    grid-template-columns: 1fr;
  }

  .admin-danger-row {
    flex-direction: column;
  }

  .admin-danger-row form,
  .admin-actions-row .secondary {
    width: 100%;
  }

  .admin-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-nav a {
    width: 100%;
  }

  .admin-table-wrap {
    overflow-x: visible;
  }

  .admin-table-cards {
    border-collapse: separate;
    min-width: 0;
  }

  .admin-table-cards thead {
    display: none;
  }

  .admin-table-cards,
  .admin-table-cards tbody,
  .admin-table-cards tr,
  .admin-table-cards td {
    display: block;
    width: 100%;
  }

  .admin-table-cards tbody {
    display: grid;
    gap: 12px;
  }

  .admin-table-cards tr {
    background: rgba(249, 251, 250, 0.72);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
  }

  .admin-table-cards td {
    border-bottom: 0;
    padding: 8px 0;
  }

  .admin-table-cards td + td {
    border-top: 1px solid rgba(213, 220, 224, 0.72);
  }

  .admin-table-cards td::before {
    color: var(--muted);
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    text-transform: uppercase;
  }
}

/* --- Accessibilité clavier --- */
a:focus-visible,
button:focus-visible,
.download:focus-visible,
.secondary:focus-visible,
.brand-lockup:focus-visible,
.admin-nav a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(5, 121, 111, 0.55);
  outline-offset: 2px;
}

button:focus-visible,
.download:focus-visible {
  outline-color: rgba(255, 255, 255, 0.9);
  outline-offset: -4px;
  box-shadow: 0 0 0 3px var(--accent-strong);
}

/* --- État de chargement des boutons --- */
.is-loading {
  cursor: progress;
  pointer-events: none;
}

.is-loading::before {
  animation: spin 0.7s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  border-top-color: #ffffff;
  content: "";
  display: inline-block;
  height: 15px;
  margin-right: 9px;
  width: 15px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Téléchargement indisponible --- */
.download-disabled {
  background: #eef2f1;
  box-shadow: none;
  color: #65747c;
  cursor: not-allowed;
  font-size: 15px;
  gap: 10px;
  min-height: 56px;
}

.download-disabled:hover {
  background: #eef2f1;
  transform: none;
}

/* --- Pages légales --- */
.legal-shell {
  max-width: 760px;
}

.legal-head {
  margin-bottom: 22px;
}

.legal-head h1 {
  font-family: "Iowan Old Style", "Hoefler Text", Georgia, serif;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 12px 0 6px;
}

.legal-head .brand-lockup {
  margin-bottom: 18px;
}

.legal-head .muted {
  font-size: 13px;
}

.legal-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 16px;
  padding: 24px 26px;
}

.legal-block h2 {
  font-family: "Iowan Old Style", "Hoefler Text", Georgia, serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 12px;
}

.legal-block p,
.legal-block li {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.62;
}

.legal-block p {
  margin: 0 0 10px;
}

.legal-block p:last-child {
  margin-bottom: 0;
}

.legal-block ul {
  margin: 4px 0 0;
  padding-left: 22px;
}

.legal-block li {
  margin-bottom: 6px;
}

.legal-block a {
  color: var(--accent-strong);
}

.legal-foot {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
  padding: 18px 0 6px;
}

.legal-foot a {
  color: var(--accent-strong);
}

.site-foot {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 14px;
  justify-content: space-between;
  margin-top: 38px;
  padding: 22px 0 4px;
}

.site-foot a {
  color: var(--accent-strong);
}

.site-foot-links {
  display: flex;
  gap: 10px;
}

.site-foot-links span[aria-hidden="true"] {
  color: var(--line-strong);
}

/* --- Mouvement réduit --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .download:hover,
  button:hover {
    transform: none;
  }
}
