@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("./public/fonts/montserrat-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #080d1d;
  --panel: #10192f;
  --panel-deep: #0a1123;
  --surface: #1a2235;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f7f8fb;
  --muted: #8d95a8;
  --coral: #ff5a5f;
  --cyan: #00e5d6;
  --violet: #7a6cff;
  font-family: "Montserrat", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 0, rgba(91, 91, 255, 0.11), transparent 420px),
    radial-gradient(circle at 8% 52%, rgba(255, 90, 95, 0.07), transparent 360px),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  width: 100%;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 7px clamp(18px, 3vw, 48px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(8, 13, 29, 0.9);
  backdrop-filter: blur(14px);
}

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

.admin-brand img {
  width: 140px;
  height: 56px;
  object-fit: contain;
  object-position: left center;
}

.admin-brand span {
  padding: 7px 10px;
  color: var(--coral);
  border: 1px solid rgba(255, 90, 95, 0.28);
  border-radius: 8px;
  background: rgba(255, 90, 95, 0.08);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
}

.public-link {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 800;
}

.admin-main {
  width: 100%;
  padding: 44px clamp(18px, 3vw, 48px) 56px;
}

.admin-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.admin-intro > div:first-child {
  max-width: 760px;
}

.admin-intro p:first-child,
.section-kicker {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 15px;
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 900;
  letter-spacing: -2.2px;
  line-height: 1.03;
}

h1 span {
  color: var(--coral);
}

h2 {
  margin-bottom: 7px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.7px;
}

h3 {
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 900;
}

.admin-description,
.panel-heading p,
.login-panel > div:nth-child(2) > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.summary-status > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6b7280;
  box-shadow: 0 0 0 4px rgba(107, 114, 128, 0.1);
}

.admin-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(circle at 100% 0, rgba(91, 91, 255, 0.055), transparent 40%),
    linear-gradient(145deg, rgba(16, 25, 47, 0.98), rgba(10, 17, 35, 0.98));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.14);
}

.login-panel {
  display: grid;
  max-width: 920px;
  grid-template-columns: auto minmax(220px, 0.9fr) minmax(320px, 1.25fr);
  gap: 22px;
  align-items: center;
  margin: 36px auto 0;
}

.panel-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: var(--coral);
  border: 1px solid rgba(255, 90, 95, 0.24);
  border-radius: 14px;
  background: rgba(255, 90, 95, 0.08);
}

.panel-icon svg {
  width: 27px;
  height: 27px;
}

label {
  display: block;
  margin: 0 0 8px;
  color: #c9ced9;
  font-size: 10px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  outline: none;
  background: rgba(8, 13, 29, 0.8);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input,
select {
  height: 44px;
  padding: 0 13px;
}

textarea {
  min-height: 88px;
  padding: 12px 13px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 229, 214, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 229, 214, 0.07);
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button,
.remove-domain-button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease;
}

.primary-button {
  min-height: 44px;
  padding: 0 18px;
  color: white;
  border-radius: 10px;
  background: var(--coral);
  box-shadow: 0 8px 28px rgba(255, 90, 95, 0.2);
}

.primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

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

.secondary-button,
.ghost-button {
  min-height: 40px;
  padding: 0 14px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: var(--surface);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--cyan);
}

.form-message {
  min-height: 18px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.form-message[data-type="error"] {
  color: #ff8084;
}

.form-message[data-type="success"] {
  color: var(--cyan);
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 34px 0 16px;
}

.dashboard-toolbar h2 {
  margin-bottom: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.domain-settings,
.status-settings {
  grid-column: span 6;
}

.previous-domains {
  grid-column: span 8;
}

.summary-panel {
  grid-column: span 4;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 22px;
}

.heading-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.heading-icon.coral {
  color: var(--coral);
}

.heading-icon.cyan {
  color: var(--cyan);
}

.heading-icon.violet {
  color: var(--violet);
}

.two-columns {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 12px;
}

.two-columns.equal-columns {
  grid-template-columns: 1fr 1fr;
}

.status-row,
.status-field-label {
  margin-top: 15px;
}

.live-preview {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 0 13px;
  border: 1px solid rgba(255, 90, 95, 0.14);
  border-radius: 9px;
  background: rgba(255, 90, 95, 0.045);
  font-size: 10px;
}

.live-preview span {
  color: var(--muted);
}

.live-preview strong {
  color: var(--coral);
  overflow-wrap: anywhere;
  text-align: right;
}

.domain-editor {
  display: grid;
  gap: 8px;
}

.domain-row {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
}

.remove-domain-button {
  display: grid;
  width: 40px;
  height: 44px;
  place-items: center;
  color: #ff7c80;
  border: 1px solid rgba(255, 90, 95, 0.2);
  border-radius: 9px;
  background: rgba(255, 90, 95, 0.07);
  font-size: 18px;
}

.summary-panel {
  background:
    radial-gradient(circle at 100% 0, rgba(255, 90, 95, 0.1), transparent 42%),
    linear-gradient(145deg, #111a30, #0a1123);
}

.summary-panel h3 {
  margin-bottom: 18px;
  font-size: 21px;
}

.summary-status {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 13px;
  padding: 0 15px;
  border: 1px solid rgba(0, 229, 214, 0.18);
  border-radius: 10px;
  background: rgba(0, 229, 214, 0.05);
}

.summary-status > span {
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(0, 229, 214, 0.08), 0 0 16px rgba(0, 229, 214, 0.4);
}

.summary-status[data-status="degraded"] > span,
.summary-status[data-status="maintenance"] > span {
  background: #f6b73c;
  box-shadow: 0 0 0 5px rgba(246, 183, 60, 0.08);
}

.summary-status[data-status="offline"] > span {
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(255, 90, 95, 0.08);
}

.summary-status small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9px;
}

.summary-status strong {
  font-size: 13px;
}

.summary-panel dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 13px 0;
}

.summary-panel dl div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(8, 13, 29, 0.6);
}

.summary-panel dt {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
}

.summary-panel dd {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.last-saved {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.save-bar {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 17, 35, 0.91);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
}

.save-bar .form-message {
  min-height: 0;
  margin: 0 auto 0 0;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

@media (max-width: 880px) {
  .admin-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-panel {
    grid-template-columns: auto 1fr;
  }

  .login-panel form {
    grid-column: 1 / -1;
  }

  .domain-settings,
  .status-settings,
  .previous-domains,
  .summary-panel {
    grid-column: span 12;
  }
}

@media (max-width: 560px) {
  .admin-topbar {
    height: 64px;
    padding-inline: 14px;
  }

  .admin-brand {
    gap: 7px;
  }

  .admin-brand img {
    width: 116px;
    height: 48px;
  }

  .admin-brand span {
    padding: 6px 7px;
    font-size: 8px;
  }

  .public-link {
    width: 40px;
    height: 40px;
    min-height: 40px;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }

  .public-link svg {
    width: 17px;
    height: 17px;
  }

  .admin-main {
    padding: 30px 14px 40px;
  }

  .admin-intro {
    margin-bottom: 20px;
  }

  h1 {
    font-size: 38px;
    letter-spacing: -1.7px;
  }

  .login-panel {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .panel-icon {
    width: 48px;
    height: 48px;
  }

  .password-row,
  .two-columns,
  .two-columns.equal-columns {
    grid-template-columns: 1fr;
  }

  .dashboard-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-panel {
    padding: 17px;
  }

  .save-bar {
    align-items: stretch;
    flex-direction: column;
  }
}
