:root {
  color-scheme: dark;
  --ink: #f3dfbd;
  --muted: #a99b87;
  --surface: rgba(28, 23, 18, 0.92);
  --surface-raised: #261e17;
  --line: rgba(225, 188, 135, 0.2);
  --ember: #d7853b;
  --ember-bright: #f0a85c;
  --green: #78b77c;
  --red: #d86d5d;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.46);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #110e0b; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 5%, rgba(164, 79, 30, 0.22), transparent 34rem),
    radial-gradient(circle at 88% 96%, rgba(89, 50, 25, 0.2), transparent 28rem),
    linear-gradient(145deg, #17110d 0%, #0c0b0a 70%);
}

.grain {
  position: fixed;
  inset: 0;
  opacity: 0.12;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

.shell {
  width: min(100% - 2rem, 720px);
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 5rem) 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-mark { color: var(--ember-bright); font-size: 1.5rem; line-height: 1; }

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(1.5rem, 5vw, 3.2rem);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 2.2rem;
  width: 92px;
  height: 3px;
  background: var(--ember);
  box-shadow: 0 0 28px rgba(215, 133, 59, 0.7);
}

.login-panel { max-width: 580px; }

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--ember-bright);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 8vw, 4.3rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.login-panel > p {
  max-width: 32rem;
  margin: 1.3rem 0 2rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

label, .label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.input-row { display: flex; gap: 0.65rem; }

input, button {
  min-height: 48px;
  border-radius: 11px;
  font: inherit;
}

input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  padding: 0.75rem 1rem;
  color: var(--ink);
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  background: rgba(7, 6, 5, 0.55);
  outline: none;
}

input:focus { border-color: var(--ember); box-shadow: 0 0 0 3px rgba(215, 133, 59, 0.16); }

button {
  border: 1px solid transparent;
  padding: 0.72rem 1.25rem;
  color: #1a1009;
  font-weight: 760;
  cursor: pointer;
  background: var(--ember-bright);
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

button:hover { background: #ffc077; transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:focus-visible { outline: 3px solid rgba(240, 168, 92, 0.45); outline-offset: 3px; }
button:disabled { cursor: wait; opacity: 0.65; transform: none; }

.status-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.status-heading h1 { font-size: clamp(2rem, 7vw, 3.7rem); }

.badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(8, 7, 6, 0.45);
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.badge.online { color: var(--green); }
.badge.offline { color: var(--red); }
.badge.checking .dot { animation: pulse 1s ease-in-out infinite; }

.address-card {
  margin: 2.4rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  background: linear-gradient(130deg, rgba(215, 133, 59, 0.11), rgba(0, 0, 0, 0.15));
}

.address {
  display: flex;
  width: 100%;
  min-height: auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(1rem, 4.4vw, 1.5rem);
  font-weight: 700;
  text-align: left;
  overflow-wrap: anywhere;
  background: transparent;
}

.address:hover { color: var(--ember-bright); background: transparent; transform: none; }
.copy-icon { color: var(--muted); font-family: sans-serif; font-weight: 400; }
.copy-note { display: block; min-height: 1.2em; margin-top: 0.35rem; color: var(--green); font-size: 0.8rem; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.facts div { min-width: 0; padding: 1rem 1.05rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div:nth-child(3n) { border-right: 0; }
.facts div:nth-last-child(-n + 3) { border-bottom: 0; }
.facts dt { margin-bottom: 0.4rem; color: var(--muted); font-size: 0.75rem; }
.facts dd { margin: 0; font-weight: 720; overflow-wrap: anywhere; }

.dns-section {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.05rem;
  background: rgba(7, 6, 5, 0.25);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dns-summary { color: var(--muted); font-size: 0.72rem; letter-spacing: 0; text-transform: none; }
.dns-summary.synced { color: var(--green); }
.dns-summary.pending { color: var(--ember-bright); }

.dns-resolvers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }

.resolver {
  min-width: 0;
  border-left: 2px solid var(--line);
  padding-left: 0.65rem;
}

.resolver.ok { border-color: var(--green); }
.resolver.pending { border-color: var(--ember); }
.resolver-name { display: block; margin-bottom: 0.25rem; color: var(--muted); font-size: 0.75rem; }
.resolver-address { display: block; font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.83rem; overflow-wrap: anywhere; }
.resolver-ttl { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.7rem; }

.message { min-height: 1.5em; margin: 1rem 0 0; color: var(--muted); line-height: 1.5; }
.message.error, .status-panel .message.error { color: #ef8b7d; }

.actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.5rem; }
.secondary { border-color: var(--line); color: var(--ink); background: var(--surface-raised); }
.secondary:hover { border-color: var(--ember); background: #302319; }
.connect-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0.72rem 1.25rem;
  color: #1a1009;
  font-weight: 760;
  text-decoration: none;
  background: var(--ember-bright);
  transition: transform 150ms ease, background 150ms ease;
}
.connect-button:hover { background: #ffc077; transform: translateY(-1px); }
.connect-button:focus-visible { outline: 3px solid rgba(240, 168, 92, 0.45); outline-offset: 3px; }
.connect-button[aria-disabled="true"] { pointer-events: none; opacity: 0.5; }
.text-button { min-height: 42px; padding-inline: 0.75rem; color: var(--muted); background: transparent; }
.text-button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
.last-check { margin-left: auto; color: var(--muted); font-size: 0.76rem; }

[hidden] { display: none !important; }

@keyframes pulse { 50% { opacity: 0.35; } }

@media (max-width: 620px) {
  .shell { width: min(100% - 1.1rem, 720px); padding-top: 1.2rem; }
  .panel { border-radius: 17px; }
  .input-row { flex-direction: column; }
  .status-heading { align-items: flex-end; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .facts div, .facts div:nth-child(3n), .facts div:nth-last-child(-n + 3) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .facts div:nth-child(2n) { border-right: 0; }
  .facts div:nth-last-child(-n + 2) { border-bottom: 0; }
  .actions { flex-wrap: wrap; }
  .last-check { width: 100%; margin-left: 0; }
  .dns-resolvers { grid-template-columns: 1fr; gap: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

