@font-face {
  font-family: 'Cinzel';
  font-weight: 700;
  font-display: swap;
  src: url('font/cinzel-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Nunito Sans';
  font-weight: 400 700;
  font-display: swap;
  src: url('font/nunito-sans.woff2') format('woff2');
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #15243a;
  --bg-deep: #101724;
  --accent: #598ac3;
  --accent-hover: #7ab0e0;
  --gold: #d29f32;
  --text: #b7cedd;
  --text-bright: #dce8eb;
  --text-dim: #6b7f94;
  --border: #47516b;
  --error: #e05555;
  --success: #4caf50;
}

body {
  font-family: 'Nunito Sans', system-ui, sans-serif;
  background: var(--bg-deep) url('img/background.jpg') center top / cover no-repeat fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(16, 23, 36, 0.6), rgba(16, 23, 36, 0.95));
  z-index: 0;
  pointer-events: none;
}

body > * {
  position: relative;
  z-index: 1;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

h1,
h2,
h3 {
  font-family: 'Cinzel', serif;
  color: var(--text-bright);
}

/* Layout */

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Header */

header {
  padding: 12px 0;
  position: relative;
  z-index: 50;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1340px;
  background: rgba(16, 23, 36, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 8px;
  padding: 16px 24px;
}

.logo {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

/* Two-tone wordmark: the realm name carries the gold accent. */
.logo .text-gold {
  color: var(--gold);
  transition: color 0.18s ease;
}

/* Hover: the gold warms up and casts a faint glow, the rest brightens to white. */
.logo:hover {
  color: #ffffff;
  text-shadow: 0 0 14px rgba(210, 159, 50, 0.35);
}

.logo:hover .text-gold {
  color: var(--gold-bright, #e8b84b);
}

nav {
  display: flex;
  gap: 28px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

nav a {
  color: var(--text-bright);
}

nav a:hover {
  color: var(--accent-hover);
}

/* Hero */

/* Homepage hero fills the space between header and footer, vertically centered. */
.home main {
  display: flex;
  flex-direction: column;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 32px 0;
}

/* Two columns: copy + steps on the left, pricing on the right. */
.hero > .container {
  max-width: 1340px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: center;
}

.hero-copy {
  text-align: left;
}

.eyebrow {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.eyebrow-diamond {
  margin-right: 10px;
  vertical-align: 2px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 12px 0 14px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* Second-colour segment of the title ("with friends"). */
.hero h1 .accent {
  color: var(--gold);
}

.hero p {
  font-size: 1.18rem;
  color: var(--text-bright);
  max-width: 600px;
  margin: 0;
  line-height: 1.55;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.hero-pricing .pricing-cards {
  margin-top: 0;
}

/* Enlarged cards in the hero (homepage is the only place cards appear). */
.hero .pricing-card {
  width: 236px;
  padding: 30px 26px;
  gap: 12px;
}

.hero .pricing-card h3 {
  font-size: 1.3rem;
}

.hero .pricing-eyebrow {
  font-size: 0.72rem;
}

.hero .pricing-card .btn {
  margin-top: 8px;
  padding: 13px;
  font-size: 0.95rem;
}

/* Pricing cards */

.pricing-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin-top: 36px;
}

.pricing-card {
  position: relative;
  background: linear-gradient(180deg, rgba(24, 33, 50, 0.85), rgba(13, 19, 30, 0.88));
  border: 1px solid rgba(71, 81, 107, 0.65);
  border-radius: 8px;
  padding: 32px 28px;
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 18px 38px -20px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Gold inset frame on every panel */
.pricing-card::after {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 1;
  border: 1px solid rgba(210, 159, 50, 0.30);
  border-radius: 5px;
  pointer-events: none;
}

.pricing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px -22px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  border-color: rgba(89, 138, 195, 0.55);
}

/* Themed tier descriptor (Outpost / Keep / Kingdom) */
.pricing-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 0.66rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
}

/* Optional "Most popular" pill. Include the element to show it, omit to hide. */
.pricing-card .pricing-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  background: var(--gold);
  color: #1a1206;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

.pricing-card-featured {
  transform: scale(1.05);
  border-color: rgba(210, 159, 50, 0.55);
  background: linear-gradient(180deg, rgba(34, 32, 40, 0.9), rgba(18, 17, 22, 0.92));
}

.pricing-card-featured::after {
  border-color: rgba(210, 159, 50, 0.6);
}

.pricing-card-featured:hover {
  transform: scale(1.05) translateY(-5px);
}

.pricing-card-featured .pricing-eyebrow {
  color: var(--gold);
}

.pricing-card h3 {
  font-size: 1.1rem;
}

/* Card content sits above the gold inset frame */
.pricing-card > * {
  position: relative;
  z-index: 2;
}

.pricing-period {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Trial price treatment: gold "3 Days Free" pill + "then $X/mo". Used on the pricing cards and the
   setup page. The amount (.price-amount) and, on setup, the trial-end date (.trial-date) are runtime
   slots; everything wraps (no fixed widths) so long translations never force horizontal scroll. */
.pricing-trial {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
}

.pricing-trial-pill {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #1a1206;
  background: var(--gold);
  border-radius: 8px;
  padding: 8px 20px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.pricing-trial-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-bright);
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.pricing-trial-price .trial-then {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: lowercase;
}

/* Pre-checkout trial terms, below the price on the setup page and under the homepage cards. */
.trial-disclosure {
  width: 100%;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--text-dim);
  text-align: center;
  margin-top: 14px;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.trial-disclosure .price-amount,
.trial-disclosure .trial-date {
  color: var(--text-bright);
  font-weight: 700;
}

/* On the homepage the disclosure is a <p> inside .hero, so the .hero p rule (bigger, bright,
   left-stuck via margin:0) would override it. Scope above it to center the block under the cards
   and keep the small dim treatment. */
.hero .trial-disclosure {
  max-width: 520px;
  margin: 14px auto 0;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--text-dim);
  text-shadow: none;
}

.pricing-card .btn {
  margin-top: 8px;
  width: 100%;
  text-align: center;
  padding: 10px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 22px;
}

.step {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.step-number {
  width: 48px;
  height: 48px;
  margin: 2px 0 0;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.25rem;
}

.step h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.step p {
  font-size: 0.95rem;
  color: var(--text-bright);
  line-height: 1.6;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Below the two-column threshold: collapse the hero to one column (copy, steps, then pricing). */
@media (max-width: 1199px) {
  .hero {
    flex: none;
    padding: 48px 0 32px;
  }

  .hero > .container {
    grid-template-columns: 1fr;
    gap: 36px;
    max-width: 560px;
  }

  .hero-copy {
    text-align: center;
  }

  /* Let the eyebrow wrap on small screens so it never forces horizontal scroll. */
  .eyebrow {
    white-space: normal;
  }

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

  .step {
    text-align: left;
  }
}

/* Below 640px the pricing cards stack to one column so nothing overflows. */
@media (max-width: 640px) {
  .pricing-cards {
    flex-direction: column;
    align-items: stretch;
  }

  .pricing-card,
  .hero .pricing-card {
    width: 100%;
  }

  .pricing-card-featured {
    transform: none;
  }

  .pricing-card-featured:hover {
    transform: translateY(-5px);
  }
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 10px 32px;
  background: var(--bg-deep);
  color: #fff;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s, background 0.15s;
}

.btn:hover {
  border-color: var(--accent);
  background: var(--border);
  color: #fff;
}

/* Disabled and closed-registration share one muted, dashed treatment so they read
   clearly as inactive, distinct from the solid secondary button. */
.btn:disabled,
.nav-disabled {
  cursor: not-allowed;
  color: var(--text-dim);
}

.btn:disabled {
  opacity: 0.55;
  background: transparent;
  border-color: var(--border);
  border-style: dashed;
}

/* Hold the muted look on hover (the base .btn:hover / .btn-primary:hover would light it up). */
.btn:disabled:hover {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}

.nav-disabled {
  opacity: 0.7;
}

.btn-primary {
  background: transparent;
  border-color: var(--accent);
  background-image: linear-gradient(90deg, #465da9, #457878);
}

.btn-primary:hover {
  background-image: linear-gradient(90deg, #5570c0, #528f8f);
  border-color: var(--accent-hover);
  color: #fff;
}

/* Full-width block button (e.g. Add Server). */
.btn-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
}

.btn-block .btn-plus {
  font-size: 1.1em;
  line-height: 1;
  color: var(--gold);
}

.btn-block:hover {
  border-color: rgba(210, 159, 50, 0.6);
}

main {
  flex: 1;
}

main>.container {
  padding-top: 40px;
  padding-bottom: 40px;
}


/* Empty state (zero servers / first run). */
.server-empty {
  text-align: center;
  padding: 40px 24px 36px;
  border: 1px dashed rgba(71, 81, 107, 0.7);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.server-empty img {
  width: 56px;
  height: 56px;
  opacity: 0.85;
  margin-bottom: 16px;
}

.server-empty h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.server-empty p {
  font-size: 0.9rem;
  color: var(--text-dim);
  max-width: 360px;
  margin: 0 auto 22px;
  line-height: 1.6;
}

.server-empty .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.server-empty .btn-plus {
  color: var(--gold);
}

/* Footer */

footer {
  color: var(--text-dim);
  font-size: 0.78rem;
  background: linear-gradient(#0f1520, var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 0;
}

footer .container {
  text-align: center;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 6px;
}

.footer-links a {
  color: inherit;
}

.footer-sep {
  color: var(--gold);
  font-size: 0.55rem;
}

.footer-links a:hover {
  color: var(--accent-hover);
}

.footer-copy {
  color: #3d4f5e;
}

/* Legal pages */

.legal {
  position: relative;
  max-width: 680px;
  margin: 48px auto;
  padding: 32px;
  line-height: 1.7;
  background: linear-gradient(180deg, rgba(24, 33, 50, 0.85), rgba(13, 19, 30, 0.88));
  border: 1px solid rgba(71, 81, 107, 0.65);
  border-radius: 8px;
  box-shadow: 0 18px 38px -20px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.legal::after {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 0;
  border: 1px solid rgba(210, 159, 50, 0.28);
  border-radius: 5px;
  pointer-events: none;
}

.legal > * {
  position: relative;
  z-index: 1;
}

.legal h2 {
  margin-bottom: 24px;
}

.legal p {
  margin-bottom: 16px;
}

.legal-notice {
  color: var(--text-dim);
  font-style: italic;
}

.legal-notice:empty {
  display: none;
}

/* Forms */

.form-page main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
}

.form {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 28px 24px 40px;
  background: linear-gradient(180deg, rgba(24, 33, 50, 0.85), rgba(13, 19, 30, 0.88));
  border: 1px solid rgba(71, 81, 107, 0.65);
  border-radius: 8px;
  box-shadow: 0 18px 38px -20px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.form::after {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 0;
  border: 1px solid rgba(210, 159, 50, 0.28);
  border-radius: 5px;
  pointer-events: none;
}

.form > * {
  position: relative;
  z-index: 1;
}

.form h2 {
  text-align: center;
  font-size: 1.4rem;
  letter-spacing: 1px;
  margin-bottom: 24px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

input[type=text],
input[type=email],
input[type=password],
select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-deep);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 4px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

input[type=text]:focus,
input[type=email]:focus,
input[type=password]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

.field-error {
  display: none;
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 4px;
}

.field-error.visible {
  display: block;
}

.form-error {
  font-size: 0.85rem;
  color: var(--error);
  margin-top: 8px;
  text-align: center;
}

.form-warn {
  font-size: 0.85rem;
  color: var(--gold);
  margin-top: 8px;
  text-align: center;
}

.form-success {
  font-size: 0.85rem;
  color: var(--success);
  margin-top: 8px;
  text-align: center;
}

.form-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 20px;
  text-align: center;
}

.form .btn {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  text-align: center;
}

.form-link {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Dashboard */

.dashboard {
  position: relative;
  max-width: 640px;
  background: linear-gradient(180deg, rgba(24, 33, 50, 0.85), rgba(13, 19, 30, 0.88));
  border: 1px solid rgba(71, 81, 107, 0.65);
  border-radius: 8px;
  padding: 28px 24px 32px;
  margin-top: 40px;
  margin-bottom: 40px;
  box-shadow: 0 18px 38px -20px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dashboard::after {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 0;
  border: 1px solid rgba(210, 159, 50, 0.28);
  border-radius: 5px;
  pointer-events: none;
}

.dashboard > * {
  position: relative;
  z-index: 1;
}

.dashboard-header {
  margin-bottom: 24px;
}

.dashboard-header h1 {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

/* Account identity line: email ◆ Change Password */
.dashboard-account {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.dashboard-account .acct-email {
  color: var(--text-bright);
}

.dashboard-account .acct-sep {
  color: var(--gold);
  font-size: 0.6rem;
}

.dashboard-account .acct-link {
  color: var(--accent);
}

.dashboard-account .acct-link:hover {
  color: var(--accent-hover);
}

.dashboard-actions {
  margin-top: 24px;
}

/* Server cards */

.server-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.server-card {
  position: relative;
  background: linear-gradient(180deg, rgba(24, 33, 50, 0.85), rgba(13, 19, 30, 0.88));
  border: 1px solid rgba(71, 81, 107, 0.65);
  border-left: 2px solid rgba(210, 159, 50, 0.45);
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 18px 38px -20px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.server-card:hover {
  box-shadow: 0 26px 50px -22px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  border-color: rgba(89, 138, 195, 0.5);
  border-left-color: rgba(210, 159, 50, 0.6);
}

.server-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.server-card h3 {
  font-size: 1.1rem;
}

.server-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.server-card-running .server-status { color: var(--success); }
.server-card-provisioning .server-status { color: var(--gold); animation: pulse 1.5s ease-in-out infinite; }
.server-card-failed .server-status { color: var(--error); }
.server-card-stopped .server-status { color: var(--text-dim); }

/* Status dot: a CSS shape, not the font glyph (font glyphs carry side-bearing and an
   off-center baseline that render differently per font). font-size:0 hides the glyph
   the template/JS still put in the span; the shape is drawn here in currentColor. */
.server-status-dot {
  font-size: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.server-card-stopped .server-status-dot { border-radius: 2px; }
.server-card-failed .server-status-dot {
  background: none;
  position: relative;
}
.server-card-failed .server-status-dot::before,
.server-card-failed .server-status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 11px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}
.server-card-failed .server-status-dot::before { transform: rotate(45deg); }
.server-card-failed .server-status-dot::after { transform: rotate(-45deg); }

/* Optimistic feedback while a control action is in flight: dim and block input
   until the poll reflects the new state. */
.server-card-busy { opacity: 0.6; pointer-events: none; }

/* Card sub-elements are always in the DOM (the dashboard patches values in place);
   visibility is driven by these classes, set identically by the initial render and
   the poll. */
.server-card .server-connect,
.server-card .server-connect-hint { display: none; }
.server-card.has-connect .server-connect { display: flex; }
.server-card.has-connect .server-connect-hint { display: block; }

.server-card .btn-stop,
.server-card .btn-start,
.server-card .btn-retry,
.server-card .server-card-failed-note,
.server-card .server-card-pastdue-note,
.server-card .btn-manage,
.server-card .btn-backups { display: none; }
.server-card.server-card-running .btn-stop { display: inline-block; }
.server-card.server-card-running.sub-active .btn-backups { display: inline-block; }
.server-card.server-card-stopped.sub-active .btn-backups { display: inline-block; }
.server-card.server-card-stopped.sub-active .btn-start { display: inline-block; }
.server-card.server-card-failed.sub-active .btn-retry { display: inline-block; }
.server-card.server-card-failed .server-card-failed-note { display: block; }
.has-customer .server-card.has-subscription.sub-pastdue .server-card-pastdue-note { display: flex; }
.has-customer .server-card.has-subscription.sub-pastdue .btn-manage,
.has-customer .server-card.has-subscription.sub-active.server-card-running .btn-manage,
.has-customer .server-card.has-subscription.sub-active.server-card-stopped .btn-manage { display: inline-block; }

.server-card .server-sub-info:empty { display: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.server-connect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.server-connect-label {
  flex-basis: 100%;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.server-address {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 4px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(89, 138, 195, 0.4) transparent;
}

.server-address.is-plain {
  color: var(--text-bright);
}

.server-copy {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 6px 12px;
  cursor: pointer;
  font-family: 'Nunito Sans', sans-serif;
}

.server-copy:hover {
  border-color: var(--accent);
  color: var(--text-bright);
}

.server-connect-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding-top: 8px;
  margin-bottom: 12px;
  line-height: 1.8;
}

.server-connect-hint strong {
  color: var(--text);
}

.server-card-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.server-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-shrink: 0;
}

/* Labels never wrap; a tight row wraps the actions block below the sub-info instead (.server-card-footer flex-wrap). */
.server-card-actions .btn {
  white-space: nowrap;
}

/* Layout A footer: renewal on the left, actions on the right, divided. */
.server-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  row-gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(71, 81, 107, 0.4);
}

.server-card-footer .server-sub-info,
.server-card-footer .server-card-actions {
  margin-top: 0;
}

.btn-stop:hover {
  border-color: var(--error);
  background: rgba(224, 85, 85, 0.14);
  color: #fff;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.8rem;
}

.server-sub-info {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 8px;
  min-width: 0;
}

.server-sub-warning {
  color: var(--gold);
}

.server-sub-error {
  color: var(--error);
}

.text-gold {
  color: var(--gold);
}

/* View transitions */

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 72ms;
}


/* ===== Loading spinner: assembling voxel block ===== */
:root { --hk-cobble: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%20shape-rendering='crispEdges'%3E%3Crect%20width='16'%20height='16'%20fill='%23565b63'/%3E%3Crect%20x='1'%20y='1'%20width='4'%20height='3'%20fill='%239aa0a8'/%3E%3Crect%20x='6'%20y='1'%20width='4'%20height='4'%20fill='%23b0b6bd'/%3E%3Crect%20x='11'%20y='1'%20width='4'%20height='3'%20fill='%23868c95'/%3E%3Crect%20x='1'%20y='5'%20width='3'%20height='4'%20fill='%23a7adb5'/%3E%3Crect%20x='5'%20y='6'%20width='4'%20height='3'%20fill='%239aa0a8'/%3E%3Crect%20x='10'%20y='5'%20width='5'%20height='4'%20fill='%23868c95'/%3E%3Crect%20x='1'%20y='10'%20width='5'%20height='5'%20fill='%239aa0a8'/%3E%3Crect%20x='7'%20y='10'%20width='3'%20height='5'%20fill='%23b0b6bd'/%3E%3Crect%20x='11'%20y='10'%20width='4'%20height='3'%20fill='%23a7adb5'/%3E%3Crect%20x='11'%20y='13'%20width='4'%20height='2'%20fill='%23868c95'/%3E%3C/svg%3E"); /* @kind other */ }

.hk-spinner { width: 64px; height: 64px; position: relative; }
.hk-spinner .pc { position: absolute; width: 22px; height: 22px; animation: hk-assemble 3.4s ease-out infinite; }
.hk-spinner .cb { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-30deg) rotateY(-45deg); }
.hk-spinner .fc { position: absolute; width: 22px; height: 22px; image-rendering: pixelated; background-image: var(--hk-cobble); background-size: 11px 11px; }
.hk-spinner .fc-f  { transform: translateZ(11px); box-shadow: inset 0 0 0 22px rgba(0,0,0,0.10), inset 0 0 0 1.5px rgba(0,0,0,0.6); }
.hk-spinner .fc-r  { transform: rotateY(90deg) translateZ(11px); box-shadow: inset 0 0 0 22px rgba(0,0,0,0.5), inset 0 0 0 1.5px rgba(0,0,0,0.6); }
.hk-spinner .fc-l  { transform: rotateY(-90deg) translateZ(11px); box-shadow: inset 0 0 0 22px rgba(0,0,0,0.5), inset 0 0 0 1.5px rgba(0,0,0,0.6); }
.hk-spinner .fc-bk { transform: rotateY(180deg) translateZ(11px); box-shadow: inset 0 0 0 22px rgba(0,0,0,0.55), inset 0 0 0 1.5px rgba(0,0,0,0.6); }
.hk-spinner .fc-t  { transform: rotateX(90deg) translateZ(11px); box-shadow: inset 0 0 0 22px rgba(255,255,255,0.28), inset 0 0 0 1.5px rgba(0,0,0,0.6); }
.hk-spinner .fc-bt { transform: rotateX(-90deg) translateZ(11px); box-shadow: inset 0 0 0 22px rgba(0,0,0,0.62), inset 0 0 0 1.5px rgba(0,0,0,0.6); }
@keyframes hk-assemble {
  0%   { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(0.5); }
  16%  { opacity: 1; }
  44%  { opacity: 1; transform: translate(0,0) scale(1); }
  86%  { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(0.5); }
}
@media (prefers-reduced-motion: reduce) {
  .hk-spinner .pc { animation: hk-fade 1.4s ease-in-out infinite alternate; transform: none; }
  @keyframes hk-fade { from { opacity: 0.45; } to { opacity: 1; } }
}

/* Full-area loading state (checkout, provisioning hand-off) */
.hk-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 40px; min-height: 220px; }
.hk-loading h2 { font-family: 'Cinzel', serif; font-size: 1.2rem; color: var(--text-bright); }
.hk-loading p { font-size: 0.85rem; color: var(--text-dim); }


/* Small spinner for inline use (e.g. price being fetched) */
.hk-spinner.is-sm { transform: scale(0.52); }
.price-spinner-slot { position: relative; overflow: visible; }
.price-spinner-slot .hk-spinner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.55); }
.pricing-card .price-spinner-slot .hk-spinner { transform: translate(-50%, calc(-50% + 4px)) scale(0.55); }


/* Past-due billing note */
.server-card-pastdue-note { align-items: center; gap: 8px; font-size: 0.85rem; color: var(--error); margin: 4px 0 14px; }
.server-card-pastdue-note::before { content: "\26A0"; font-size: 0.95em; }

/* Coming-soon pricing state (real price still shown; only the button is disabled) */
.pricing-card-soon { opacity: 0.92; }
.btn-soon { border-style: dashed !important; opacity: 0.7; cursor: default; color: var(--text-dim) !important; background: transparent !important; }

/* Price slot holds the voxel spinner while the price loads, then the trial price. The spinner is
   absolutely positioned, so align-items governs only the loaded price row: baseline to match
   .pricing-trial-price (and the setup page, which has no .pricing-card ancestor). */
.pricing-card .price-spinner-slot { min-height: 2.4rem; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; }
/* Setup-page trial price has no .pricing-card ancestor, so its spinner slot needs its own room. */
.pricing-trial-price.price-spinner-slot { min-height: 2.4rem; }

/* Language picker: a native <details> dropdown in the top bar, opens on click, no JavaScript. */
.lang-switcher { position: relative; }
.lang-switcher > summary { list-style: none; cursor: pointer; color: var(--text-bright); }
.lang-switcher > summary::-webkit-details-marker { display: none; }
.lang-switcher > summary::after { content: " \25BE"; color: var(--text-dim); }
.lang-switcher[open] > summary { color: var(--accent-hover); }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 140px;
  padding: 6px 0;
  background: rgba(16, 23, 36, 0.95);
  border: 1px solid var(--border);
  border-radius: 4px;
  z-index: 20;
}
.lang-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}
.lang-menu a:hover { background: var(--bg-deep); color: var(--accent-hover); }

/* ===== Promo banner: optional dismissible strip above the header ===== */
.promo-banner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 44px; text-align: center;
  background: linear-gradient(#0f1520, var(--bg));
  border-bottom: 1px solid rgba(210,159,50,0.28);
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 0.9rem;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-bright);
  position: relative;
}
.promo-banner strong { color: var(--gold); }
.promo-banner code {
  font-family: 'Nunito Sans', sans-serif; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: #1a1206;
  background: var(--gold); border-radius: 20px; padding: 4px 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  position: relative; top: -2px;
}
.promo-banner-dismiss {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-dim); font-size: 1.1rem;
  line-height: 1; cursor: pointer; border-radius: 4px; transition: color 0.15s ease, background 0.15s ease;
}
.promo-banner-dismiss:hover { color: var(--text-bright); background: rgba(255,255,255,0.06); }
.promo-banner.is-hidden { display: none; }

/* --- Backup modal --- */
.bk-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8,12,18,0.74);
  display: flex; align-items: center; justify-content: center;
}
.bk-modal {
  background: linear-gradient(180deg, rgba(24,33,50,0.85), rgba(13,19,30,0.88));
  border: 1px solid var(--border); border-radius: 10px;
  width: 90%; max-width: 660px; max-height: min(800px, 90vh);
  display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.bk-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.bk-head h2 { margin: 0; font-size: 1.05rem; color: var(--text-bright); }
.bk-title { min-width: 0; }
.bk-subtitle { font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-close {
  background: none; border: 1px solid var(--border); color: var(--text-dim); font-size: 1.2rem;
  cursor: pointer; width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; padding: 0;
  line-height: 1; display: flex; align-items: center; justify-content: center;
}
.bk-close:hover { color: var(--text-bright); border-color: var(--accent); background: rgba(255,255,255,0.06); }
.bk-busy { cursor: default; }
.bk-busy .bk-close { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.bk-body {
  padding: 18px 24px; overflow-y: auto; flex: 1;
}
.bk-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--text-dim); padding: 40px 0; }
.bk-loading-label { font-size: 0.85rem; }
.bk-error { color: var(--error); text-align: center; padding: 40px 0; }
.bk-error-box { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px 0; }
.bk-error-box .bk-error { padding: 0; }
.bk-section-label {
  font-family: 'Cinzel', serif; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-dim);
}
.bk-toprow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; justify-content: space-between; }
.bk-empty { color: var(--text-dim); text-align: center; padding: 20px 0; font-size: 0.9rem; }
.bk-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--border); gap: 14px;
}
.bk-row:last-child { border-bottom: none; }
.bk-row-main { flex: 1; min-width: 0; }
.bk-row-name { font-size: 0.88rem; color: var(--text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-row-meta { font-size: 0.74rem; font-family: monospace; color: var(--text-dim); margin-top: 2px; }
.bk-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.bk-row-actions .btn { padding: 5px 12px; font-size: 0.72rem; }
