:root {
  --bg: #181818;
  --panel: #0a0a09;
  --panel-soft: #111111;
  --panel-muted: #1d1d1d;
  --line: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text-soft: #a8adb4;
  --topbar-bg: #0a0a09;
  --topbar-height: 64px;
  --subnav-height: 48px;
  --subheader-bg: #111111;
  --highlight: #35cd96;
  --highlight-2: #229e45;
  --star-color: #f7d046;
  --odd: #046eef;
  --odd-hover: #2e86f5;
  --danger: #ef4444;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: "Open Sans", sans-serif;
  font-size: 14px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--highlight) 18%, transparent), transparent 28%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--topbar-bg) 34%, transparent), transparent 32%),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  width: min(1360px, calc(100% - 32px));
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}

.brand-copy {
  min-width: 0;
}

.brand-copy.logo-only span {
  display: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #06110d;
  font-weight: 800;
  background: linear-gradient(135deg, var(--highlight), var(--highlight-2));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--highlight) 28%, transparent);
}

.brand-mark.has-image {
  background: transparent;
  box-shadow: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 0;
}

.brand-copy strong {
  display: block;
  font-size: 0.96rem;
  letter-spacing: 0.06em;
  color: #ffffff;
}

.brand-copy span {
  display: block;
  color: #ffffff;
  font-size: 0.72rem;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 22px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-link {
  display: inline-block;
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: 0.2s ease;
}

button.header-link {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  margin: 0;
}

.header-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 3px;
  border-radius: 999px;
  background: var(--subheader-bg);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.header-link:hover {
  color: #ffffff;
  opacity: 0.82;
}

.header-link.active {
  color: #ffffff;
  opacity: 1;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.12);
}

.header-link.active::after {
  transform: scaleX(1);
}

.header-profile-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.header-profile-menu[hidden] {
  display: none !important;
}

.header-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 36px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.header-menu-btn:hover,
.header-profile-menu.open .header-menu-btn {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.42);
  transform: translateY(-1px);
}

.header-menu-dot {
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  flex: 0 0 auto;
}

.header-profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 75;
  display: none;
  min-width: 178px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: color-mix(in srgb, var(--topbar-bg) 82%, black 18%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.header-profile-menu.open .header-profile-dropdown {
  display: grid;
  gap: 4px;
}

.header-profile-dropdown-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.header-profile-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.auth-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 280px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--topbar-bg) 82%, white 18%);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ghost-btn,
.primary-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.92rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.ghost-btn {
  background: var(--subheader-bg);
  color: #ffffff;
  font-weight: 700;
}

.ghost-btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
  filter: brightness(1.08);
}

.primary-btn {
  color: #03110a;
  border-color: transparent;
  background: linear-gradient(135deg, var(--highlight), var(--highlight-2));
  font-weight: 800;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--highlight) 26%, transparent);
}

/* Content Area */
.register-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  width: 100%;
}

.register-card {
  width: min(460px, 100%);
  border: 1px solid color-mix(in srgb, var(--topbar-bg) 84%, white 16%);
  border-radius: 20px;
  background: var(--subheader-bg);
  box-shadow:
    0 22px 46px rgba(0, 0, 0, 0.44),
    0 0 0 1px color-mix(in srgb, var(--subheader-bg) 72%, white 28%);
  overflow: hidden;
}

.register-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--topbar-bg);
  background: var(--topbar-bg);
}

.register-title strong {
  display: block;
  font-size: 1.15rem;
  color: #ffffff;
  font-weight: 800;
}

.register-title span {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.4;
}

.register-form {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: var(--subheader-bg);
}

.form-group {
  display: grid;
  gap: 8px;
}

.form-group label {
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.form-group input {
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--topbar-bg) 70%, white 14%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--subheader-bg) 90%, white 10%), var(--subheader-bg));
  color: var(--text);
  padding: 0 16px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-group input::placeholder {
  color: #717a84;
}

.form-group input:focus {
  border-color: var(--highlight);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--highlight) 22%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, color-mix(in srgb, var(--subheader-bg) 82%, white 18%), var(--subheader-bg));
}

.register-actions {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.register-submit {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--highlight), var(--highlight-2));
  color: #03110a;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--highlight) 26%, transparent);
  transition: filter 0.18s ease, transform 0.18s ease;
}

.register-submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.register-submit:disabled {
  cursor: wait;
  filter: grayscale(0.25) brightness(0.9);
  transform: none;
  opacity: 0.78;
}

.register-message {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 48%, transparent);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: #ffffff;
  font-size: 0.82rem;
  line-height: 1.45;
}

.register-message[data-type="success"] {
  border-color: color-mix(in srgb, var(--highlight) 52%, transparent);
  background: color-mix(in srgb, var(--highlight) 16%, transparent);
}

.back-link {
  text-align: center;
  margin-top: 4px;
}

.back-link a {
  color: var(--highlight);
  font-size: 0.85rem;
  font-weight: 700;
  transition: opacity 0.2s;
}

.back-link a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .topbar-inner {
    width: min(100% - 20px, 1480px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding: 8px 0;
  }

  .register-container {
    align-items: flex-start;
    padding: 24px 12px 32px;
  }
}
