:root {
  --ink: #182230;
  --muted: #6d7888;
  --soft: #f7f8fb;
  --line: #e3e8f0;
  --primary: #4656d9;
  --primary-dark: #3544bd;
  --success: #138a60;
  --danger: #c3404b;
  --white: #ffffff;
  --shadow: 0 24px 64px rgba(32, 48, 83, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--soft);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(70, 86, 217, 0.25);
  outline-offset: 3px;
}

.page-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
}

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.brand-copy strong {
  font-size: 18px;
}

.brand-copy span {
  color: var(--muted);
}

.topbar-actions,
.service-status,
.service-label,
.hero-meta,
.account-actions,
.profile-summary,
.avatar-actions,
.verification-title,
.service-card-top {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 18px;
}

.service-status {
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.service-status i,
.meta-dot,
#service-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: #c2c9d4;
}

.service-status.is-up i,
.meta-dot.is-up,
#service-dot.is-up {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(19, 138, 96, 0.12);
}

.service-status.is-down i,
.meta-dot.is-down,
#service-dot.is-down {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(195, 64, 75, 0.12);
}

.text-button,
.inline-button,
.icon-button {
  border: 0;
  background: transparent;
}

.text-button,
.inline-button {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.text-button:hover,
.inline-button:hover {
  color: var(--primary-dark);
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 72px;
  align-items: center;
  min-height: 330px;
  padding: 68px 0 60px;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow,
.section-kicker {
  display: block;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 650px;
  margin: 16px 0 20px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-copy p,
.view-heading p,
.service-section p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.hero-meta {
  gap: 10px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
}

.hero-orbit {
  position: relative;
  width: 250px;
  height: 250px;
  justify-self: end;
}

.orbit-ring {
  position: absolute;
  inset: 15px;
  border: 1px solid rgba(70, 86, 217, 0.22);
  border-radius: 50%;
  transform: rotate(-26deg) skewX(-12deg);
}

.ring-two {
  inset: 45px 0;
  border-color: rgba(24, 34, 48, 0.14);
  transform: rotate(48deg) skewX(-18deg);
}

.orbit-core {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  color: var(--white);
  background: var(--primary);
  border-radius: 28px;
  box-shadow: 0 18px 38px rgba(70, 86, 217, 0.28);
  font-size: 19px;
  font-weight: 800;
  transform: translate(-50%, -50%);
}

.orbit-node {
  position: absolute;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--primary);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(32, 48, 83, 0.08);
  font-size: 10px;
  font-weight: 800;
}

.node-one { top: 18px; left: 44px; }
.node-two { right: 12px; bottom: 48px; }
.node-three { bottom: 17px; left: 51px; }

.workspace {
  min-height: 480px;
  padding: 54px clamp(24px, 6vw, 78px);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-view,
.register-view,
.account-view {
  max-width: 720px;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.view-heading {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 34px;
}

.view-heading h2,
.service-section h2 {
  margin: 9px 0 10px;
  font-size: clamp(25px, 4vw, 38px);
  letter-spacing: -0.03em;
}

.view-number {
  color: #c5cad5;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.form-stack {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.field em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

.field input,
.verification-row input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field input::placeholder,
.verification-row input::placeholder {
  color: #aeb6c4;
}

.field input:focus,
.verification-row input:focus {
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(70, 86, 217, 0.1);
  outline: 0;
}

.primary-button,
.secondary-button,
.wide-secondary-button,
.outline-button,
.danger-button,
.upload-button {
  min-height: 46px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 16px 0 18px;
  color: var(--white);
  background: var(--primary);
  border: 1px solid var(--primary);
}

.primary-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.primary-button b {
  font-size: 19px;
  font-weight: 500;
}

.form-switch {
  margin-top: 26px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.verification-panel {
  padding: 16px;
  background: #fafbfe;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.verification-title {
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 800;
}

.icon-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--primary);
  border-radius: 50%;
  font-size: 18px;
}

.icon-button:hover {
  background: #edf0ff;
}

.captcha-question {
  display: grid;
  min-height: 50px;
  place-items: center;
  margin-bottom: 10px;
  color: var(--ink);
  background: var(--white);
  border: 1px dashed #cbd2df;
  border-radius: 6px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.verification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.secondary-button,
.wide-secondary-button {
  padding: 0 16px;
  color: var(--primary);
  background: var(--white);
  border: 1px solid rgba(70, 86, 217, 0.35);
}

.secondary-button:hover,
.wide-secondary-button:hover {
  background: #f0f2ff;
  border-color: var(--primary);
}

.wide-secondary-button {
  width: 100%;
  margin-top: 10px;
}

.verification-hint,
.avatar-actions p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.verification-hint.is-success,
.verification-state.is-success {
  color: var(--success);
}

.verification-hint.is-error,
.form-message.is-error {
  color: var(--danger);
}

.verification-state {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.form-message {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form-message.is-success {
  color: var(--success);
}

.profile-summary {
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.profile-summary > div:nth-child(2) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-summary strong {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-summary span:not(.account-badge) {
  color: var(--muted);
  font-size: 13px;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  color: var(--primary);
  background: #edf0ff;
  border-radius: 50%;
  font-weight: 800;
}

.avatar.large {
  width: 58px;
  height: 58px;
  font-size: 20px;
}

.avatar.medium {
  width: 76px;
  height: 76px;
  font-size: 23px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-badge {
  margin-left: auto;
  padding: 6px 9px;
  color: var(--success);
  background: #eaf8f2;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}

.avatar-editor {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 4px 0 10px;
}

.avatar-actions {
  flex-wrap: wrap;
  gap: 10px 14px;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  color: var(--primary);
  background: #f0f2ff;
  border: 1px solid rgba(70, 86, 217, 0.2);
}

.upload-button:hover {
  background: #e6e9ff;
}

#avatar-file {
  display: none;
}

.avatar-actions p {
  flex-basis: 100%;
}

.account-actions {
  justify-content: space-between;
  gap: 12px;
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.outline-button,
.danger-button {
  padding: 0 15px;
  background: var(--white);
}

.outline-button {
  color: var(--ink);
  border: 1px solid var(--line);
}

.outline-button:hover {
  border-color: #b8c1d0;
}

.danger-button {
  color: var(--danger);
  border: 1px solid rgba(195, 64, 75, 0.3);
}

.danger-button:hover {
  background: #fff5f5;
  border-color: var(--danger);
}

.service-section {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 430px);
  gap: 60px;
  align-items: center;
  padding: 76px 0;
}

.service-card {
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
}

.service-card-top {
  justify-content: space-between;
  gap: 10px;
}

.service-label {
  gap: 9px;
  font-size: 13px;
  font-weight: 800;
}

.service-code {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.service-bar {
  height: 6px;
  margin: 20px 0;
  overflow: hidden;
  background: #eef1f6;
  border-radius: 20px;
}

#service-bar-fill {
  display: block;
  width: 32%;
  height: 100%;
  background: #c2c9d4;
  border-radius: inherit;
  transition: width 0.35s, background 0.35s;
}

#service-bar-fill.is-up {
  width: 100%;
  background: var(--success);
}

#service-bar-fill.is-down {
  width: 12%;
  background: var(--danger);
}

.service-endpoints {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px 14px;
  color: var(--muted);
  font-size: 11px;
}

.service-endpoints code {
  overflow: hidden;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 0 34px;
  color: #9aa4b3;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100% - 44px));
}

.toast {
  padding: 13px 15px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  box-shadow: 0 14px 30px rgba(32, 48, 83, 0.12);
  font-size: 13px;
  line-height: 1.45;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 30px, 620px);
  }

  .topbar {
    min-height: 68px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .service-status {
    display: none;
  }

  .hero-section {
    display: block;
    min-height: auto;
    padding: 48px 0 42px;
  }

  .hero-copy h1 {
    font-size: clamp(38px, 12vw, 56px);
  }

  .hero-orbit {
    display: none;
  }

  .workspace {
    padding: 34px 22px;
  }

  .service-section {
    display: block;
    padding: 52px 0;
  }

  .service-card {
    margin-top: 25px;
  }

  footer {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .page-shell {
    width: calc(100% - 24px);
  }

  .brand-copy span,
  .text-button#refresh-service {
    display: none;
  }

  .workspace {
    padding: 28px 16px;
  }

  .view-heading {
    gap: 12px;
  }

  .view-number {
    font-size: 11px;
  }

  .verification-row {
    grid-template-columns: 1fr;
  }

  .secondary-button {
    width: 100%;
  }

  .avatar-editor,
  .account-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-badge {
    margin-left: 0;
  }

  .account-actions button {
    width: 100%;
  }
}
