:root {
  color-scheme: dark;
  --background: #020c0e;
  --surface: #06181c;
  --surface-raised: #082127;
  --line: #12343b;
  --line-soft: #0b282e;
  --text: #f3f7f8;
  --muted: #8ba2a8;
  --faint: #60747a;
  --accent: #00d9f5;
  --accent-light: #8bf4ff;
  --success: #36d296;
  --danger: #ef8179;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--background); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font: 15px/1.55 "Manrope", system-ui, sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; letter-spacing: 0; }

button, a { -webkit-tap-highlight-color: transparent; }

.shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(2, 12, 14, 0.92);
  backdrop-filter: blur(14px);
}

.header-row {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font: 600 17px/1 "Unbounded", sans-serif;
}

.brand img { display: block; border-radius: 7px; }

.identity { display: flex; align-items: center; gap: 16px; min-width: 0; }
.identity-email { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
/* The language control carries fifty entries now, so it reads as a proper
   field rather than a small code badge: the current language is written in
   itself, which is also what makes the list findable. The chevron is drawn in
   CSS rather than fetched or inlined as data, so no image and no style
   exception is needed for it. */
.locale-control {
  position: relative;
  margin: 0 0 0 auto;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
}
.locale-control::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}
.locale-control select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 38px;
  max-width: 190px;
  padding: 6px 32px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: 600 13px/1.2 "Manrope", system-ui, sans-serif;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}
.locale-control select:hover { border-color: var(--muted); color: var(--text); }
.locale-control select:focus-visible {
  outline: 2px solid var(--accent, #4fd1c5);
  outline-offset: 2px;
}

.main { padding: 48px 0 80px; }

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 10px;
  font: 700 26px/1.25 "Unbounded", sans-serif;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-layout {
  min-height: calc(100vh - 164px);
  display: grid;
  place-items: center;
}

.auth-stack { width: min(430px, 100%); }

.auth-panel {
  width: 100%;
  padding: 36px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.auth-purchase-summary {
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(0, 217, 245, 0.07);
}
.auth-purchase-summary h2 { margin-bottom: 7px; }
.auth-purchase-summary strong { display: block; font-size: 17px; }
.auth-purchase-summary p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

.auth-panel p { margin-bottom: 26px; color: var(--muted); }

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 48px;
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: #041216;
  color: var(--text);
}

input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 217, 245, 0.12); }
.otp-input-group {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 48px));
  justify-content: center;
  gap: clamp(4px, 2vw, 9px);
  direction: ltr;
  margin-bottom: 18px;
}
.otp-digit {
  min-width: 0;
  min-height: 52px;
  margin: 0;
  padding: 8px 2px;
  text-align: center;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  caret-color: var(--accent-light);
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 17px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.button:hover { border-color: var(--accent); color: var(--accent-light); }
.button:disabled { opacity: 0.5; cursor: wait; }
.button-primary { border-color: transparent; background: var(--accent); color: #021417; }
.button-primary:hover { border-color: transparent; color: #021417; background: var(--accent-light); }
.button-quiet { min-height: 38px; }
.button-small { padding: 7px 13px; font-size: 13px; }
.button-block { width: 100%; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.inline-form input { min-width: 0; margin: 0; text-transform: uppercase; }
.compact-notice { margin: 12px 0 0; }
.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; }

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.text-button:hover { color: var(--accent-light); }
.auth-actions { margin-top: 18px; display: flex; justify-content: space-between; gap: 16px; }

.notice {
  margin-bottom: 18px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.notice-error { border-color: rgba(239, 129, 121, 0.42); background: rgba(239, 129, 121, 0.08); color: var(--danger); }

.dashboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.eyebrow { margin-bottom: 7px; color: var(--accent); font-weight: 800; text-transform: uppercase; font-size: 11px; }

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.icon-button:hover { border-color: var(--accent); color: var(--accent-light); }
.icon-button:disabled { opacity: 0.5; }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 22px; align-items: start; }

.panel {
  margin-bottom: 22px;
  padding: 25px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.plan-name { display: block; margin-bottom: 7px; font: 700 24px/1.3 "Unbounded", sans-serif; }
.panel-copy { color: var(--muted); }
.selected-purchase { border-top: 1px solid var(--line); margin: 16px 0; padding-top: 12px; }
.selected-purchase h3 { font-size: 14px; margin: 0 0 8px; }
.selected-purchase p { margin: 6px 0 0; }
.annual-price-breakdown {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px;
  margin-bottom: 5px; font-variant-numeric: tabular-nums;
}
.annual-price-original {
  color: var(--muted); font-size: 13px;
  text-decoration-thickness: 1px; text-decoration-color: currentColor;
}
.annual-price-current { color: var(--text); font-size: 18px; font-weight: 800; }
.annual-price-saving { color: var(--success); font-size: 13px; font-weight: 700; }
.purchase-contract-terms { display: block; }
.purchase-chooser { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.purchase-chooser h3 { margin: 0 0 11px; font-size: 14px; }
.purchase-plan-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.purchase-period-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.purchase-option {
  min-width: 0; min-height: 42px; padding: 8px 9px;
  border: 1px solid var(--line); border-radius: 6px;
  background: transparent; color: var(--text); font-weight: 800; cursor: pointer;
}
.purchase-option small { display: block; color: var(--muted); font-weight: 600; }
.purchase-option.is-selected { border-color: var(--accent); background: rgba(0,217,245,.10); color: var(--accent-light); }
.purchase-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.renewal-state { margin: 12px 0; color: var(--muted); }
.test-requirement { margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; }
.test-requirement .text-button { margin-top: 6px; }
.schedule-list { list-style: none; margin: 0; padding: 0; }
.schedule-list li { padding: 12px 0; }
.schedule-list li + li { border-top: 1px solid var(--line); }
.schedule-list p { margin: 6px 0 0; }
.renewal-control {
  display: flex; align-items: center; gap: 9px; margin: 16px 0;
  color: var(--text); font-weight: 600; cursor: pointer;
}
.renewal-control[hidden] { display: none; }
.renewal-control input { width: 18px; height: 18px; accent-color: var(--accent); }
.renewal-control:has(input:disabled) { color: var(--muted); cursor: default; }

.status-badge {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-badge.active { border-color: rgba(54, 210, 150, 0.38); color: var(--success); }
.status-badge.inactive { border-color: rgba(239, 129, 121, 0.32); color: var(--danger); }

.managed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}

.managed-row:first-child { padding-top: 0; border-top: 0; }
.managed-row:last-child { padding-bottom: 0; }
.managed-info { min-width: 0; }
.managed-title { display: flex; align-items: center; gap: 8px; font-weight: 800; overflow-wrap: anywhere; }
.managed-subtitle { margin-top: 3px; color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); }

.current-label {
  flex: none;
  padding: 2px 7px;
  border: 1px solid rgba(0, 217, 245, 0.3);
  border-radius: 999px;
  color: var(--accent-light);
  font-size: 10px;
  text-transform: uppercase;
}

.danger-button { color: var(--danger); border-color: rgba(239, 129, 121, 0.3); }

.application-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.application {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

a.application:hover { border-color: var(--accent); }
.application-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 8px; background: rgba(0, 217, 245, 0.1); color: var(--accent-light); }
.application-icon svg { width: 19px; height: 19px; display: block; }
.application strong, .application small { display: block; }
.application small { color: var(--muted); }
.application-disabled { opacity: 0.48; }

.account-links { display: flex; flex-wrap: wrap; gap: 18px; padding: 0 2px; }
.account-links a { color: var(--muted); text-underline-offset: 4px; }
.account-links a:hover { color: var(--accent-light); }

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 24px;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-raised);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1080px); }
  .header-row { gap: 12px; }
  .brand span { display: none; }
  .main { padding-top: 28px; }
  .identity-email { display: none; }
  .auth-panel { padding: 26px 20px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .application-list { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .managed-row { align-items: flex-start; }
  .purchase-plan-options { grid-template-columns: 1fr; }
}
