:root {
  --bg: #030914;
  --panel: rgba(6, 18, 35, 0.86);
  --panel-strong: #07182c;
  --line: rgba(116, 194, 255, 0.24);
  --text: #f4f9ff;
  --muted: #9bb7d2;
  --blue: #28a8ff;
  --blue-strong: #0878ff;
  --cyan: #62e6ff;
  --danger: #ff6b7a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(40, 168, 255, 0.28), transparent 34rem),
    linear-gradient(135deg, #030914 0%, #061324 54%, #02050c 100%);
  color: var(--text);
  font-family: "Kanit", system-ui, sans-serif;
  letter-spacing: 0;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 6vw;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 9, 20, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(98, 230, 255, 0.55);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), #0b3671);
  box-shadow: 0 0 28px rgba(40, 168, 255, 0.42);
}

nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang {
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.lang.active,
.login-link {
  color: var(--text);
}

.login-link,
.user-badge {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.terms-shell,
.form-shell {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 58px 0 36px;
}

.city-banner {
  position: relative;
  min-height: clamp(260px, 42vw, 480px);
  margin-bottom: 40px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07182c;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.city-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(3, 9, 20, 0.88) 0%, rgba(3, 9, 20, 0.26) 52%, transparent 78%);
  pointer-events: none;
}

.city-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.city-banner-copy {
  position: absolute;
  z-index: 1;
  left: clamp(22px, 5vw, 58px);
  bottom: clamp(24px, 6vw, 62px);
  display: grid;
  max-width: min(520px, 72%);
}

.city-banner-copy span,
.city-banner-copy small {
  color: var(--cyan);
  font-weight: 700;
}

.city-banner-copy strong {
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 1;
  font-weight: 800;
}

.terms-hero,
.form-head {
  max-width: 820px;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 6vw, 5.4rem);
  line-height: 0.98;
  font-weight: 800;
}

h2 {
  font-size: 1.45rem;
}

.muted,
.terms-hero p,
.form-head p,
.rule-block p,
footer,
.status-panel p {
  color: var(--muted);
}

.terms-panel,
.whitelist-form,
.status-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.terms-panel {
  padding: clamp(22px, 4vw, 42px);
}

.rule-block {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0 18px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.rule-block span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #001321;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  font-weight: 800;
}

.rule-block h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.accept-text {
  padding: 18px;
  border: 1px solid rgba(98, 230, 255, 0.3);
  border-radius: 8px;
  background: rgba(40, 168, 255, 0.08);
}

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

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--blue-strong));
  box-shadow: 0 14px 36px rgba(8, 120, 255, 0.34);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ghost-button {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.whitelist-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: clamp(18px, 4vw, 34px);
}

label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.wide {
  grid-column: 1 / -1;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(98, 230, 255, 0.14);
}

textarea {
  resize: vertical;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.form-message {
  white-space: pre-line;
  padding: 14px 16px;
  border-radius: 8px;
  color: #ffd9de;
  background: rgba(255, 107, 122, 0.12);
}

.form-message[data-type="info"] {
  color: #d5f7ff;
  background: rgba(40, 168, 255, 0.12);
}

footer {
  padding: 26px 6vw 40px;
  text-align: center;
  font-size: 0.92rem;
}

.center-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.status-panel {
  width: min(520px, 100%);
  padding: 36px;
  text-align: center;
}

.status-icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border-radius: 8px;
  color: #001321;
  background: var(--cyan);
  font-size: 2rem;
  font-weight: 800;
}

.status-icon.error {
  background: var(--danger);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 320px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 107, 122, 0.4);
  border-radius: 8px;
  background: rgba(57, 12, 22, 0.94);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
}

@media (max-width: 720px) {
  .site-header {
    padding: 0 18px;
  }

  .brand span:last-child {
    display: none;
  }

  .whitelist-form {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.35rem;
  }

  .city-banner {
    min-height: 300px;
  }

  .city-banner img {
    object-position: 58% center;
  }

  .city-banner::after {
    background: linear-gradient(0deg, rgba(3, 9, 20, 0.94) 0%, rgba(3, 9, 20, 0.12) 72%);
  }

  .city-banner-copy {
    max-width: calc(100% - 44px);
  }

  .rule-block {
    grid-template-columns: 42px 1fr;
    gap: 0 12px;
  }
}

/* Discord whitelist application */
.application-page {
  min-height: 100vh;
  background: #070c12 url('/assets/welcome-arrow.webp') center / cover fixed no-repeat;
}

.application-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(3, 8, 14, 0.9) 0%, rgba(4, 12, 21, 0.48) 46%, rgba(2, 7, 12, 0.18) 100%);
  pointer-events: none;
}

.application-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  padding: 0 max(24px, calc((100vw - 1020px) / 2));
  border-bottom: 1px solid rgba(112, 189, 255, 0.16);
  background: rgba(6, 11, 17, 0.96);
}

.town-brand,
.header-account,
.discord-profile,
.step-heading,
.roadmap-step,
.success-step {
  display: flex;
  align-items: center;
}

.town-brand { gap: 10px; }
.town-brand strong { font-size: 1rem; }
.town-logo { width: 38px; height: 34px; overflow: hidden; }
.town-logo img { width: 56px; height: 38px; object-fit: cover; transform: translate(-9px, -2px); }
.header-account { gap: 12px; }
.discord-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #17212d; }
.logout-link { display: none; color: var(--muted); font-size: .78rem; }
.header-account:hover .logout-link { display: inline; }

.application-stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 66px);
  padding: 22px;
}

.application-card {
  width: min(510px, 100%);
  padding: 18px;
  border: 1px solid rgba(109, 163, 206, 0.2);
  border-radius: 28px;
  background: rgba(11, 17, 25, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
}

.card-inner {
  padding: 24px 22px 22px;
  border: 1px solid rgba(128, 175, 211, 0.18);
  border-radius: 24px;
  background: rgba(14, 20, 29, 0.94);
}

.application-card h1 {
  margin: 6px 0 4px;
  font-size: 1.1rem;
  line-height: 1.35;
  text-align: center;
}

.application-subtitle { margin-bottom: 10px; color: #8497aa; font-size: .72rem; text-align: center; }
.application-symbol,
.success-symbol {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 8px;
  border: 1px solid #4bd3ff;
  border-radius: 50%;
  color: #4bd3ff;
}
.application-symbol span { width: 9px; height: 9px; border-radius: 50%; background: #4bd3ff; }
.success-symbol { border-color: #38bdf8; color: #38bdf8; font-size: 1.6rem; }

.discord-profile { justify-content: center; gap: 10px; min-height: 42px; margin-bottom: 13px; font-size: .82rem; }
.discord-profile .discord-avatar { border-radius: 8px; }
.pipeline-label { margin-bottom: 10px; padding: 10px 12px; border: 1px solid rgba(120, 167, 203, .18); border-radius: 12px; background: #090e14; }
.pipeline-label span { display: block; color: #62778b; font-size: .64rem; }
.pipeline-label strong { display: block; color: #74d8ff; font-size: .7rem; letter-spacing: 3px; }

.active-step { margin-bottom: 9px; padding: 10px 11px 11px; border: 1px solid rgba(63, 199, 248, .35); border-radius: 14px; background: rgba(33, 133, 173, .08); }
.step-heading { gap: 10px; margin-bottom: 9px; }
.step-heading div,
.roadmap-step div,
.success-step div { flex: 1; }
.step-heading strong,
.roadmap-step strong,
.success-step strong { display: block; font-size: .82rem; }
.step-heading small,
.roadmap-step small,
.success-step small { display: block; color: #8495a8; font-size: .65rem; }
.step-dot,
.step-index,
.roadmap-step > span,
.success-step > span,
.success-step > b { display: grid; flex: 0 0 auto; place-items: center; width: 24px; height: 24px; border: 1px solid #42cff7; border-radius: 50%; color: #58d9ff; font-size: .7rem; }
.step-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #52d8ff; }
.step-index { width: 19px; height: 19px; }

.compact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-left: 34px; padding: 12px; border: 1px solid rgba(124, 166, 199, .14); border-radius: 13px; background: rgba(6, 11, 17, .42); }
.compact-form label { gap: 5px; color: #7f93a6; font-size: .64rem; font-weight: 500; }
.compact-form input,
.compact-form select { min-width: 0; height: 38px; padding: 0 11px; border: 1px solid rgba(126, 170, 204, .24); border-radius: 7px; color: #f2f7fb; background: #161d25; font: inherit; font-size: .75rem; }
.compact-form select { color-scheme: dark; }
.compact-form input:focus,
.compact-form select:focus { border-color: #43c9f5; box-shadow: 0 0 0 2px rgba(67, 201, 245, .12); outline: 0; }
.compact-message,
.submit-application { grid-column: 1 / -1; }
.compact-message { margin: 0; padding: 8px 10px; font-size: .68rem; }
.submit-application { height: 38px; border: 1px solid #1e9dce; border-radius: 20px; color: #eafaff; background: #096e98; font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
.submit-application:hover { background: #0b84b6; }
.submit-application:disabled { cursor: wait; opacity: .65; }

.roadmap-step,
.success-step { gap: 10px; min-height: 58px; margin-top: 8px; padding: 8px 11px; border: 1px solid rgba(125, 164, 196, .16); border-radius: 13px; background: #090e14; }
.roadmap-step > span { border-color: rgba(134, 167, 193, .28); color: #6f8293; }
.discord-notice { margin-top: 10px; padding: 10px 12px 10px 34px; border: 1px solid rgba(64, 190, 239, .35); border-radius: 12px; color: #b8d9e8; background: rgba(17, 98, 130, .16); font-size: .66rem; }
.discord-notice::before { content: "✉"; margin-left: -22px; margin-right: 10px; color: #55d6ff; }

.success-card { width: min(550px, 100%); }
.success-step { border-color: rgba(55, 193, 242, .28); background: rgba(12, 94, 128, .12); }
.success-step > span,
.success-step > b { border-color: #38bdf8; color: #38bdf8; }
.success-step > b { width: 19px; height: 19px; font-size: .6rem; }
.nickname-warning { padding: 9px 11px; border: 1px solid rgba(255, 184, 72, .45); border-radius: 10px; color: #ffe0a3; background: rgba(120, 75, 7, .2); font-size: .7rem; }
.back-home { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 38px; margin-top: 10px; border: 1px solid rgba(130, 169, 200, .24); border-radius: 20px; background: #151b22; font-size: .76rem; font-weight: 700; }
.application-footer { position: relative; z-index: 2; padding: 22px; border-top: 1px solid rgba(112, 189, 255, .12); background: rgba(6, 11, 17, .94); }

@media (max-width: 600px) {
  .application-page { background-position: 61% center; }
  .application-header { height: 58px; padding: 0 16px; }
  .town-brand strong { font-size: .86rem; }
  .application-stage { align-items: start; min-height: calc(100vh - 58px); padding: 14px 10px; }
  .application-card { padding: 8px; border-radius: 20px; }
  .card-inner { padding: 18px 12px 14px; border-radius: 17px; }
  .compact-form { grid-template-columns: 1fr; margin-left: 0; }
  .compact-message,
  .submit-application { grid-column: auto; }
  .pipeline-label strong { letter-spacing: 2px; }
}
/* Blocked Discord server state */
.blocked-stage { align-items: center; }
.blocked-card h1 { color: #f4f8ff; }
.blocked-symbol {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border: 1px solid #ff667e;
  border-radius: 50%;
  color: #ff667e;
  font-size: 24px;
  font-weight: 800;
}
.blocked-reason {
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 102, 126, 0.35);
  background: rgba(82, 17, 31, 0.3);
  text-align: left;
}
.blocked-reason strong { color: #ff8da0; font-size: 14px; }
.blocked-reason p { margin: 4px 0 0; color: #aeb9c9; font-size: 11px; }
.blocked-guild-list { display: grid; gap: 8px; margin: 10px 0 16px; }
.blocked-guild {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  padding: 11px 13px;
  border: 1px solid rgba(39, 175, 255, 0.28);
  background: rgba(8, 17, 28, 0.78);
  color: #edf7ff;
  text-align: left;
  text-decoration: none;
}
.blocked-guild:hover { border-color: #27afff; background: rgba(18, 55, 82, 0.72); }
.blocked-guild span { color: #77899f; font-size: 10px; text-transform: uppercase; }
.blocked-guild strong { color: #dcecff; font-size: 12px; }
.blocked-guild small {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  color: #50c9ff;
  font-size: 11px;
}
.blocked-retry { display: grid; place-items: center; text-decoration: none; }

/* Terms and conditions */
.legal-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(1, 7, 13, 0.88) 0%, rgba(3, 10, 18, 0.48) 32%, rgba(3, 10, 18, 0.12) 72%, rgba(2, 8, 14, 0.25) 100%),
    url('/assets/welcome-arrow.webp') center top / cover fixed no-repeat;
  color: #e9f3ff;
}

.legal-header {
  position: sticky;
  top: 0;
  z-index: 20;
}

.legal-stage {
  width: min(1080px, calc(100% - 36px));
  margin: 30px auto;
}

.legal-card {
  padding: 28px 30px;
  border: 1px solid rgba(116, 194, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 13, 21, 0.94);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(10px);
}

.legal-title-row {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 128px;
  text-align: center;
}

.legal-title-copy h1 {
  margin: 4px 0 12px;
  color: #fff;
  font-size: 2.15rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.legal-title-copy p {
  margin: 0;
  color: #dbeaff;
  font-size: .84rem;
  font-weight: 600;
}

.legal-title-copy small {
  display: block;
  margin-top: 15px;
  color: #8298b2;
  font-size: .7rem;
}

.language-switch {
  position: absolute;
  top: 2px;
  right: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 78px;
  height: 28px;
  overflow: hidden;
  border: 1px solid rgba(126, 163, 201, 0.2);
  border-radius: 16px;
  background: #171e28;
}

.language-switch button {
  border: 0;
  color: #8da0b7;
  background: transparent;
  font: inherit;
  font-size: .64rem;
  font-weight: 800;
  cursor: pointer;
}

.language-switch button.active {
  color: #02101a;
  background: #39c7ff;
}

.legal-highlights {
  display: grid;
  gap: 10px;
}

.legal-highlights section,
.legal-callout {
  padding: 18px 24px;
  border: 1px solid rgba(39, 175, 255, 0.42);
  border-radius: 8px;
  background: rgba(5, 30, 43, 0.62);
}

.legal-highlights h2,
.legal-callout h2 {
  margin: 0 0 8px;
  color: #46caff;
  font-size: .82rem;
}

.legal-highlights p,
.legal-callout p {
  margin: 0;
  color: #9db0c7;
  font-size: .7rem;
  line-height: 1.75;
}

.legal-rules {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.legal-rule {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid rgba(119, 146, 176, 0.2);
  border-radius: 8px;
  background: rgba(22, 28, 37, 0.92);
}

.legal-rule-number {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(112, 153, 195, 0.35);
  border-radius: 50%;
  color: #9ab1c8;
  font-size: .68rem;
}

.legal-rule h2 {
  margin: 3px 0 10px;
  color: #f5f8fc;
  font-size: .78rem;
}

.legal-rule ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: #98aac0;
  font-size: .69rem;
  line-height: 1.65;
}

.legal-rule li::marker {
  color: #398bc4;
}

.legal-callout {
  margin-top: 10px;
}

.important-callout {
  border-color: rgba(44, 198, 255, 0.48);
  background: rgba(4, 33, 46, 0.82);
}

.warning-callout {
  border-color: rgba(255, 181, 52, 0.45);
  background: rgba(42, 30, 6, 0.64);
}

.warning-callout h2 {
  color: #ffbd45;
}

.legal-agreement {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 20px;
  border: 1px solid rgba(116, 194, 255, 0.17);
  border-radius: 8px;
  background: rgba(2, 9, 16, 0.75);
  text-align: center;
}

.legal-agreement p {
  margin: 0;
  color: #9eafc4;
  font-size: .7rem;
}

.agree-button {
  min-width: 112px;
  height: 36px;
  padding: 0 22px;
  border: 1px solid #43c9ff;
  border-radius: 19px;
  color: #fff;
  background: #0b789f;
  font: inherit;
  font-size: .66rem;
  font-weight: 800;
  cursor: pointer;
}

.agree-button:hover {
  background: #109acb;
}

.agree-button:disabled {
  cursor: wait;
  opacity: .62;
}

.terms-message[data-type='error'],
.terms-message {
  color: #ff8da0;
}

.legal-footer {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 20px;
  border-top: 1px solid rgba(116, 194, 255, 0.13);
  background: rgba(4, 9, 16, 0.9);
  color: #647b94;
  font-size: .65rem;
}

.legal-footer small {
  padding: 4px 14px;
  border: 1px solid rgba(116, 194, 255, 0.18);
  border-radius: 14px;
  color: #8fb9dc;
  font-size: .56rem;
}

@media (max-width: 700px) {
  .legal-stage { width: calc(100% - 20px); margin: 12px auto; }
  .legal-card { padding: 20px 12px; }
  .legal-title-row { min-height: 170px; padding-top: 38px; }
  .legal-title-copy h1 { font-size: 1.65rem; }
  .language-switch { top: 0; right: 0; }
  .legal-highlights section, .legal-callout { padding: 15px; }
  .legal-rule { grid-template-columns: 25px 1fr; gap: 9px; padding: 15px 12px; }
  .legal-rule-number { width: 25px; height: 25px; }
}
