:root {
  --bg: #171a1f;
  --text: #1f2933;
  --card: #ffffff;
  --line: #d7dee6;
  --primary: #0f62fe;
}

@import url("https://fonts.googleapis.com/css2?family=Bitcount+Prop+Double:wght@300;400&family=VT323&display=swap");

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "VT323", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}

h2 {
  font-family: "Bitcount Prop Double", "VT323", monospace;
  font-weight: 400;
}

h3 {
  font-family: "Bitcount Prop Double", "VT323", monospace;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  background: var(--bg);
  color: #fff;
  padding: 12px 0;
  border-bottom: 1px solid #242933;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.site-logo-wrap {
  margin: 0;
  line-height: 0;
}

.site-logo {
  display: block;
  width: min(256px, 46vw);
  height: auto;
}

.header-inner a { color: #fff; text-decoration: none; margin-left: 12px; }
.page-content { padding: 24px 0 48px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.stack { display: grid; gap: 12px; }
.row { display: flex; }
.gap-sm { gap: 8px; }
.between { justify-content: space-between; }
.middle { align-items: center; }

label { display: grid; gap: 6px; font-weight: 600; }
input, textarea, select, button {
  font: inherit;
}
input, textarea, select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}

button, .button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
button.ghost, .button.ghost {
  background: transparent;
  color: var(--primary);
}
.guest-list-section { display: grid; gap: 6px; }
.guest-list-label { font-weight: 600; font-size: 0.9em; }
.guest-list { display: grid; gap: 6px; }
.guest-item { display: flex; gap: 6px; align-items: center; }
.guest-item input { flex: 1; }
.guest-item select { width: 70px; }
.guest-item .button { padding: 4px 8px; }

button.danger, .button.danger {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}
button.danger.small, .button.danger.small {
  padding: 4px 10px;
  font-size: 0.85em;
}

.saving-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.saving-overlay[hidden] { display: none; }
.saving-box {
  background: #fff;
  border-radius: 12px;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.saving-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.flash-list { margin-bottom: 12px; display: grid; gap: 8px; }
.flash { border-radius: 8px; padding: 10px; }
.flash.error { background: #fee2e2; color: #991b1b; }
.flash.success { background: #dcfce7; color: #166534; }
.flash.info { background: #e0f2fe; color: #075985; }

table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; }

.wizard-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
}

.wizard-nav {
  display: grid;
  gap: 8px;
  align-content: start;
}

.wizard-tab {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
  text-align: left;
}

.wizard-tab.active {
  border-color: var(--primary);
  color: var(--primary);
}

.wizard-step { display: none; }
.repeat-list { display: grid; gap: 12px; }
.repeat-item {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.auth-card { max-width: 420px; margin: 24px auto; }

.refuge-login-body {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.06), transparent 40%),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 4px
    ),
    #050607;
  color: #e8ecf3;
}

.refuge-login-body .site-header {
  background: rgba(0, 0, 0, 0.88);
  border-bottom: 1px solid #242933;
}

.refuge-login-card {
  max-width: 560px;
  margin-top: 42px;
  background: rgba(5, 7, 10, 0.92);
  border: 1px solid #2a2f38;
  border-radius: 6px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
}

.refuge-login-kicker {
  margin: 0;
  color: #f06a6a;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 1.2rem;
}

.refuge-login-note {
  margin: 0;
  color: #a8b0be;
  letter-spacing: 0.04em;
  line-height: 1.35;
  padding-bottom: 12px;
  border-bottom: 1px solid #252c36;
}

.refuge-login-form {
  margin-top: 8px;
}

.refuge-login-form label {
  color: #d8dde7;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1.1rem;
}

.refuge-login-form input {
  border: 1px solid #303948;
  border-radius: 0;
  background: rgba(5, 8, 12, 0.96);
  color: #edf0f6;
  min-height: 46px;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}

.refuge-login-form input:focus {
  outline: none;
  border-color: #f04848;
  box-shadow: 0 0 0 1px #f04848;
}

.refuge-login-form button {
  border-radius: 0;
  border-color: #f04848;
  background: #f04848;
  color: #0d1015;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 1.15rem;
  min-height: 46px;
}

/* ── Global mobile base ── */
@media (max-width: 600px) {
  .container { padding: 0 10px; }
  .page-content { padding: 14px 0 36px; }
  .card { padding: 14px; }
}

/* ── Header nav wrap ── */
@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 8px;
  }
  .header-inner nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    border-top: 1px solid #242933;
    padding-top: 8px;
  }
  .header-inner nav a {
    margin-left: 0;
    font-size: 0.85rem;
    padding: 4px 0;
  }
}

/* ── Wizard tabs: horizontal scroll on mobile ── */
@media (max-width: 880px) {
  .wizard-layout { grid-template-columns: 1fr; }
  .wizard-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 4px;
  }
  .wizard-tab { white-space: nowrap; flex-shrink: 0; }
  .refuge-login-card { margin-top: 24px; padding: 16px; }
}

/* ── Form card action rows ── */
@media (max-width: 600px) {
  .refuge-form-card .row.between {
    flex-direction: column;
    gap: 10px;
  }
  .refuge-form-card .row.gap-sm {
    flex-wrap: wrap;
  }
  .refuge-form-card .row.between > form { align-self: flex-start; }
}

.refuge-form-card {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.08), transparent 45%),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 4px
    ),
    #07080a;
  border: 1px solid #2e323a;
  border-radius: 6px;
  color: #f4f6fb;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.refuge-form-title {
  margin: 0 0 10px;
  font-family: "Bitcount Prop Double", "VT323", monospace;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  color: #f1f3f7;
}

.refuge-form {
  font-family: "VT323", monospace;
  letter-spacing: 0.03em;
}

.refuge-form h3 {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f4f6fb;
}

.refuge-form label {
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #cfd5de;
}

.refuge-form input,
.refuge-form textarea,
.refuge-form select {
  border: 1px solid #303845;
  border-radius: 0;
  background: rgba(7, 9, 12, 0.92);
  color: #e7ebf3;
  min-height: 42px;
}

.refuge-form textarea {
  min-height: 96px;
}

.refuge-form input:focus,
.refuge-form textarea:focus,
.refuge-form select:focus {
  outline: none;
  border-color: #f04848;
  box-shadow: 0 0 0 1px #f04848;
}

.refuge-form .wizard-nav {
  border-right: 1px solid #232831;
  padding-right: 14px;
}

.refuge-form .wizard-tab {
  border: 1px solid #29303a;
  border-radius: 0;
  color: #171b22;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 10px 12px;
}

.refuge-form .wizard-tab.active {
  border-color: #f04848;
  color: #0d1117;
  background: #f04848;
}

.refuge-form .button,
.refuge-form button {
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-color: #f04848;
  background: #f04848;
  color: #0d1117;
}

.refuge-form .button.ghost,
.refuge-form button.ghost {
  background: transparent;
  color: #ff7c7c;
  border-color: #f04848;
}

.refuge-form .repeat-item {
  border: 1px solid #2a303a;
  border-radius: 0;
  background: rgba(6, 8, 11, 0.92);
}

.refuge-dashboard-card {
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.08), transparent 45%),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 4px
    ),
    #06070a;
  border: 1px solid #2c3139;
  border-radius: 6px;
  color: #edf0f6;
}

.refuge-dashboard-header {
  margin-bottom: 10px;
}

.refuge-dashboard-new {
  border-radius: 0;
  border-color: #f04848;
  background: #f04848;
  color: #0c0f13;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.refuge-dashboard-table {
  font-family: "VT323", monospace;
  letter-spacing: 0.04em;
}

.refuge-dashboard-table th,
.refuge-dashboard-table td {
  border-bottom: 1px solid #262c35;
  color: #e0e5ee;
  padding: 12px 10px;
  vertical-align: top;
}

.refuge-dashboard-table thead th {
  text-transform: uppercase;
  color: #9ba4b3;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.refuge-dashboard-table .button,
.refuge-dashboard-table .button.ghost {
  border-radius: 0;
  border-color: #f04848;
  color: #ff8b8b;
  background: transparent;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 880px) {
  .refuge-form .wizard-nav {
    border-right: 0;
    border-bottom: 1px solid #232831;
    padding-right: 0;
    padding-bottom: 10px;
    margin-bottom: 8px;
  }

  .refuge-form-card .row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .refuge-dashboard-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .refuge-dashboard-actions {
    flex-wrap: wrap;
  }
}

/* ── Dashboard: card layout on small screens ── */
@media (max-width: 640px) {
  .refuge-dashboard-table thead { display: none; }
  .refuge-dashboard-table,
  .refuge-dashboard-table tbody,
  .refuge-dashboard-table tr,
  .refuge-dashboard-table td { display: block; width: 100%; }

  .refuge-dashboard-table tr {
    border: 1px solid #262c35;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 10px 12px;
  }

  .refuge-dashboard-table td {
    padding: 4px 0;
    border-bottom: none;
  }

  .refuge-dashboard-table td:first-child {
    font-size: 1.1em;
    font-weight: 700;
    padding-bottom: 6px;
    margin-bottom: 4px;
    border-bottom: 1px solid #262c35;
  }

  .refuge-dashboard-table td[data-label]::before {
    content: attr(data-label) ": ";
    color: #9ba4b3;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
  }

  .refuge-dashboard-actions {
    padding-top: 6px;
    margin-top: 4px;
    border-top: 1px solid #262c35;
  }
}

/* ── Guest items: stack on very small screens ── */
@media (max-width: 480px) {
  .guest-item { flex-wrap: wrap; }
  .guest-item input { min-width: 0; }
}
