:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #0a0a0a;
  --panel-2: #0e0e0e;
  --text: #f4f4f2;
  --muted: #9d9d98;
  --quiet: #6e6e69;
  --line: #282828;
  --line-strong: #4a4a46;
  --white: #f3f3f0;
  --black: #060606;
  --green: #67d498;
  --red: #ff7c7c;
  --radius: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    var(--bg);
  background-size: 64px 64px;
  font-family: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea { font: inherit; }

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

img { display: block; max-width: 100%; }

[hidden] { display: none !important; }

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

.admin-link {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 4;
}

.admin-layout {
  display: grid;
  min-height: 100vh;
  padding: 48px 24px;
  place-items: center;
}

.admin-console {
  width: min(100%, 860px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 28px 88px rgba(0, 0, 0, 0.56);
}

.admin-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

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

.portal-brand img { width: 52px; height: 44px; object-fit: contain; }
.portal-brand > span { display: grid; gap: 1px; }
.portal-brand strong { font-size: 16px; font-weight: 760; }
.portal-brand > span > span { color: var(--quiet); font-size: 10px; text-transform: uppercase; }

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(103, 212, 152, 0.1);
}

.admin-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
}

.auth-panel,
.admin-panel {
  width: min(100%, 620px);
  margin: 72px auto 46px;
}

.admin-panel { width: 100%; }

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.auth-panel h1,
.admin-panel h1 {
  margin: 15px 0 13px;
  font-size: 44px;
  font-weight: 650;
  line-height: 1;
}

.auth-panel > p:not(.eyebrow) {
  margin: 0 0 28px;
  color: var(--muted);
}

.form-stack { display: grid; gap: 15px; }
.field { display: grid; gap: 8px; }
.field > span { color: var(--muted); font-size: 10px; font-weight: 740; }

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  background: #080808;
  outline: 0;
  transition: border-color 160ms ease, background 160ms ease;
}

.field input { height: 52px; padding: 0 15px; }
.field textarea { min-height: 210px; padding: 14px 15px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: #7a7a75; background: #0c0c0c; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms var(--ease), opacity 160ms ease;
}

.button:hover:not(:disabled) { border-color: #71716c; background: rgba(255, 255, 255, 0.04); transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: 0.4; }
.button-light { color: var(--black); border-color: var(--white); background: var(--white); }
.button-ghost { color: var(--muted); }
.button-small { min-height: 38px; padding-inline: 13px; font-size: 11px; }

.form-message {
  min-height: 22px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.form-message.is-error { color: var(--red); }
.form-message.is-success { color: var(--green); }

.admin-panel > .admin-topline {
  margin-bottom: 28px;
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  gap: 10px;
}

.is-loading::after {
  width: 13px;
  height: 13px;
  margin-left: 9px;
  content: "";
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .admin-layout { padding: 0; place-items: stretch; }
  .admin-console { min-height: 100vh; padding: 20px; border: 0; border-radius: 0; }
  .admin-link { top: 16px; right: 16px; }
  .admin-status { display: none; }
  .auth-panel, .admin-panel { margin-top: 58px; }
  .auth-panel h1, .admin-panel h1 { font-size: 36px; }
  .admin-actions { align-items: stretch; flex-direction: column; }
  .admin-actions .button { width: 100%; }
}
