:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --card: #121821;
  --surface: #121821;
  --surface-strong: #121821;
  --surface-soft: #0c1219;
  --muted: #8aa0b3;
  --text: #e6eef5;
  --green: #22c55e;
  --red: #ef4444;
  --graydot: #a3b2c0;
  --border: #1f2937;
  --accent: #60a5fa;
  --accent-strong: #1d4ed8;
  --header-top: rgba(11, 15, 20, 0.95);
  --header-bottom: rgba(11, 15, 20, 0.6);
  --header-line: #1f2937;
  --card-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  --input-bg: #0e141c;
  --badge-bg: #0f1620;
  --contact-bg: rgba(0, 0, 0, 0.25);
  --contact-border: rgba(255, 255, 255, 0.35);
  --table-row: transparent;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --card: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #f7fafc;
  --muted: #5f7084;
  --text: #132033;
  --green: #15803d;
  --red: #dc2626;
  --graydot: #94a3b8;
  --border: #d7e0ea;
  --accent: #1d4ed8;
  --accent-strong: #1e40af;
  --header-top: rgba(244, 247, 251, 0.95);
  --header-bottom: rgba(244, 247, 251, 0.72);
  --header-line: #d7e0ea;
  --card-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
  --input-bg: #ffffff;
  --badge-bg: #eef3f8;
  --contact-bg: rgba(255, 255, 255, 0.9);
  --contact-border: rgba(15, 23, 42, 0.12);
  --table-row: rgba(15, 23, 42, 0.02);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, var(--header-top) 0%, var(--header-bottom) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--header-line);
}

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

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

nav {
  display: flex;
  align-items: center;
}

h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.2px;
}

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

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
}

.theme-toggle {
  min-width: 112px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-weight: 700;
}

.main {
  position: relative;
  z-index: 1;
  padding: 18px 20px 60px;
}

.auth-shell {
  display: flex;
  justify-content: center;
  padding-top: 48px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.card,
.panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.card {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  min-height: 110px;
  padding: 14px;
}

.panel {
  margin-bottom: 18px;
  padding: 14px;
}

.auth-panel {
  width: min(100%, 460px);
  padding: 24px;
}

.auth-copy {
  margin: 0 0 18px 0;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.auth-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.section-title {
  margin: 0 0 12px 0;
  font-size: 18px;
}

.section-actions {
  margin-bottom: 10px;
}

.status-dot {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.status-up {
  background: var(--green);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.6);
}

.status-down {
  background: var(--red);
  animation: offline-blink 2.4s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
}

.status-loading {
  background: var(--graydot);
  animation: pulse 1.1s infinite;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

@keyframes pulse {
  0% {
    opacity: 0.5;
    transform: scale(0.95);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }

  100% {
    opacity: 0.5;
    transform: scale(0.95);
  }
}

@keyframes offline-blink {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
  }

  50% {
    opacity: 0.35;
    transform: scale(0.92);
    box-shadow: 0 0 28px rgba(239, 68, 68, 0.55);
  }
}

.card h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 700;
}

.url {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12.5px;
  word-break: break-all;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--badge-bg);
}

.badge.ok {
  border-color: #11341e;
  background: #0f1b13;
  color: #a9eabf;
}

.badge.err {
  border-color: #3b1212;
  background: #1f0f0f;
  color: #f5a4a4;
}

:root[data-theme="light"] .badge.ok {
  border-color: #b9e5c6;
  background: #ecfdf3;
  color: #166534;
}

:root[data-theme="light"] .badge.err {
  border-color: #f2c6c6;
  background: #fff1f1;
  color: #991b1b;
}

.footer {
  margin-top: 24px;
  padding: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  text-align: left;
  vertical-align: top;
}

.table tbody tr:nth-child(odd) {
  background: var(--table-row);
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

input,
select,
textarea,
button {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

button {
  cursor: pointer;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button.primary {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
  font-weight: 700;
}

button.ghost {
  background: transparent;
}

button.danger {
  border-color: #7f1d1d;
  background: #991b1b;
  color: #ffffff;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.form-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.auth-form input,
.auth-form button {
  width: 100%;
}

.result-wrap {
  margin-top: 12px;
}

.result-pre {
  min-height: 120px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  white-space: pre-wrap;
}

.muted,
small.muted {
  color: var(--muted);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
.link:focus-visible,
.contact:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#particles-js {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg);
}

header,
.main {
  position: relative;
  z-index: 1;
}

.contact {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--contact-border);
  background: var(--contact-bg);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  backdrop-filter: blur(8px);
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

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

@media (max-width: 720px) {
  .container {
    padding: 14px 16px;
  }

  .header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .theme-toggle {
    min-width: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .table {
    display: block;
    overflow-x: auto;
  }

  .card,
  .panel {
    border-radius: 16px;
  }
}
