:root {
  --ink: #152323;
  --muted: #5d6c69;
  --paper: #f7f8f4;
  --surface: #ffffff;
  --line: #d5ddd8;
  --forest: #176b4d;
  --forest-dark: #0e4c37;
  --ocean: #16547a;
  --coral: #b94b3f;
  --gold: #d6a638;
  --success-bg: #e5f3eb;
  --error-bg: #f8e7e5;
  --shadow: 0 14px 36px rgba(13, 31, 28, 0.12);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 5vw;
  background: #0c1718;
  color: #f7fbf8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  background: var(--forest);
  border: 3px solid #73b889;
  box-shadow: inset -5px -5px 0 rgba(0, 0, 0, 0.2);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-header nav a,
.link-button {
  color: #dbe7e1;
  font-size: 0.94rem;
  text-decoration: none;
}

.site-header nav a:hover,
.link-button:hover {
  color: #ffffff;
}

.inline-form {
  display: inline;
  margin: 0;
}

.link-button {
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.hero {
  position: relative;
  display: flex;
  min-height: min(610px, calc(100vh - 64px));
  align-items: flex-end;
  overflow: hidden;
  background-color: #194d70;
  background-image: url("/static/riftlands-map.png");
  background-position: center 42%;
  background-size: cover;
  color: #ffffff;
}

.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(3, 15, 17, 0.48);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1160px, 90vw);
  margin: 0 auto;
  padding: 76px 0 64px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #b8e7cb;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: min(11vw, 7rem);
  line-height: 0.96;
}

.hero-copy {
  max-width: 620px;
  margin: 22px 0 28px;
  color: #edf5f0;
  font-size: 1.25rem;
}

.server-address {
  display: flex;
  width: min(100%, 520px);
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 14px 13px 19px;
  background: rgba(8, 23, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
}

.server-address div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.server-label {
  color: #a9bbb3;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.server-address strong {
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 1.05rem;
}

.application-section {
  display: grid;
  width: min(1160px, 90vw);
  margin: 0 auto;
  grid-template-columns: minmax(0, 0.85fr) minmax(420px, 1.15fr);
  gap: clamp(50px, 8vw, 110px);
  padding: 88px 0 100px;
}

.application-intro {
  padding-top: 18px;
}

.application-intro h2,
.admin-heading h1,
.message-panel h1,
.login-panel h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 4rem, 3.25rem);
  line-height: 1.08;
}

.application-intro > p:not(.eyebrow) {
  max-width: 520px;
  color: var(--muted);
  font-size: 1.08rem;
}

.project-facts {
  display: grid;
  margin-top: 42px;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-facts div {
  display: grid;
  gap: 3px;
  padding: 17px 10px 17px 0;
}

.project-facts strong {
  color: var(--ocean);
  font-size: 1.08rem;
}

.project-facts span {
  color: var(--muted);
  font-size: 0.76rem;
}

.application-form,
.login-panel {
  padding: clamp(24px, 5vw, 42px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 22px;
}

.field label {
  font-size: 0.92rem;
  font-weight: 750;
}

.field input,
.field textarea {
  width: 100%;
  color: var(--ink);
  background: #fbfcfa;
  border: 1px solid #b8c6bf;
  border-radius: 4px;
  outline: none;
}

.field input {
  height: 48px;
  padding: 0 13px;
}

.field textarea {
  min-height: 150px;
  padding: 12px 13px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(23, 107, 77, 0.16);
}

.field-help {
  color: var(--muted);
  font-size: 0.78rem;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 18px;
}

.form-row-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 24px;
  color: var(--muted);
  font-size: 0.84rem;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--forest);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.button:focus-visible,
.status-tabs a:focus-visible,
.site-header a:focus-visible,
.link-button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.button-primary,
.button-approve {
  color: #ffffff;
  background: var(--forest);
  border-color: var(--forest);
}

.button-primary:hover,
.button-approve:hover {
  background: var(--forest-dark);
}

.button-light {
  color: #10201c;
  background: #ffffff;
  border-color: #ffffff;
}

.button-secondary {
  color: var(--ink);
  background: #ffffff;
  border-color: #aebcb5;
}

.button-danger {
  color: #ffffff;
  background: var(--coral);
  border-color: var(--coral);
}

.button-quiet-danger {
  color: #8d3028;
  background: transparent;
  border-color: transparent;
}

.button-wide {
  width: 100%;
}

.flash-stack {
  position: fixed;
  z-index: 30;
  top: 76px;
  right: 20px;
  display: grid;
  width: min(420px, calc(100vw - 40px));
  gap: 8px;
}

.flash {
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.flash-success {
  background: var(--success-bg);
  border-left-color: var(--forest);
}

.flash-error {
  background: var(--error-bg);
  border-left-color: var(--coral);
}

.message-page,
.login-page {
  display: grid;
  min-height: calc(100vh - 128px);
  place-items: center;
  padding: 70px 5vw;
  background-color: #e7eeea;
  background-image: url("/static/riftlands-map.png");
  background-position: center;
  background-size: cover;
  background-blend-mode: soft-light;
}

.message-panel,
.login-panel {
  width: min(100%, 560px);
}

.message-panel {
  padding: clamp(28px, 6vw, 54px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.message-panel p:not(.eyebrow) {
  margin-bottom: 28px;
  color: var(--muted);
}

.status-symbol {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  place-items: center;
  color: #ffffff;
  background: var(--forest);
  border-radius: 50%;
  font-weight: 900;
}

.login-panel h1 {
  font-size: 2.2rem;
}

.admin-shell {
  width: min(1240px, 92vw);
  min-height: calc(100vh - 128px);
  margin: 0 auto;
  padding: 58px 0 80px;
}

.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.admin-heading h1 {
  margin-bottom: 0;
  font-size: 2.8rem;
}

.capacity {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
}

.capacity strong {
  color: var(--ocean);
  font-size: 2rem;
}

.status-tabs {
  display: flex;
  gap: 6px;
  margin: 36px 0 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.status-tabs a {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.status-tabs a.active {
  color: var(--ink);
  border-bottom-color: var(--forest);
}

.status-tabs span {
  min-width: 23px;
  padding: 1px 6px;
  color: var(--ink);
  background: #e3e9e5;
  border-radius: 10px;
  text-align: center;
  font-size: 0.75rem;
}

.application-list {
  display: grid;
  gap: 12px;
}

.application-item {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.application-item-header,
.player-line,
.application-actions {
  display: flex;
  align-items: center;
}

.application-item-header {
  justify-content: space-between;
  gap: 24px;
}

.player-line {
  flex-wrap: wrap;
  gap: 9px;
}

.player-line h2 {
  margin: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 1.12rem;
}

.application-item-header p,
.application-item-header time {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.status,
.whitelist-indicator {
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pending {
  color: #76540c;
  background: #fff1c9;
  border-color: #ecd48d;
}

.status-approved,
.whitelist-indicator {
  color: #12583f;
  background: #e1f2e8;
  border-color: #acd6bc;
}

.status-rejected,
.status-revoked {
  color: #79322c;
  background: #f7e6e3;
  border-color: #e4b5af;
}

.whitelist-indicator {
  color: #124f72;
  background: #e1f0f8;
  border-color: #acd0e3;
}

.application-reason {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1px solid #e7ece9;
  border-bottom: 1px solid #e7ece9;
}

.application-reason span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.application-reason p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.application-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.application-actions form {
  margin: 0;
}

.empty-state {
  padding: 60px 24px;
  text-align: center;
  border: 1px dashed #aebcb5;
}

.empty-state h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.password-panel {
  margin-top: 42px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.password-panel summary {
  font-weight: 800;
  cursor: pointer;
}

.password-panel form {
  margin-top: 22px;
}

.site-footer {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 5vw;
  color: #b8c7c0;
  background: #0c1718;
  font-size: 0.8rem;
}

@media (max-width: 860px) {
  .application-section {
    grid-template-columns: 1fr;
    gap: 46px;
  }

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

  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  .hero {
    min-height: 590px;
  }

  .hero-content,
  .application-section,
  .admin-shell {
    width: calc(100% - 36px);
  }

  .hero h1 {
    font-size: 3.35rem;
  }

  .server-address {
    align-items: stretch;
    flex-direction: column;
  }

  .server-address .button {
    width: 100%;
  }

  .application-section {
    padding: 60px 0 72px;
  }

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

  .project-facts div + div {
    border-top: 1px solid var(--line);
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .application-item {
    padding: 18px;
  }

  .application-item-header,
  .application-reason {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .application-item-header {
    flex-direction: column;
    gap: 8px;
  }

  .application-actions,
  .application-actions form,
  .application-actions .button {
    width: 100%;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 18px;
    padding-bottom: 18px;
  }
}
