:root {
  color-scheme: dark;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  --surface: rgba(15, 23, 42, 0.92);
  --surface-strong: rgba(15, 23, 42, 0.98);
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --border: rgba(148, 163, 184, 0.18);
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.4);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.14), transparent 35%),
    linear-gradient(180deg, #020617 0%, #0f172a 80%);
}

body {
  color: #f8fafc;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('data:image/svg+xml,%3Csvg width="160" height="160" viewBox="0 0 160 160" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Ccircle cx="80" cy="80" r="1" fill="%2338bdf8"/%3E%3Cg stroke="%2394a3b8" stroke-opacity="0.08" stroke-width="1"%3E%3Cpath d="M0 0L160 160"/%3E%3Cpath d="M160 0L0 160"/%3E%3C/g%3E%3C/svg%3E')
    center/320px 320px repeat;
  pointer-events: none;
  opacity: 0.18;
}

.page-shell {
  width: min(6200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 72px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-title {
  font-size: clamp(2rem, 3vw, 3.2rem);
  margin: 0;
  line-height: 1.05;
}

.hero-copy {
  max-width: 620px;
  color: var(--muted);
  margin: 0;
  font-size: 1rem;
  line-height: 1.75;
}

.panel {
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
}

.auth-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
}

.auth-input {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.7);
  color: #f8fafc;
  padding: 0 16px;
  font-size: 1rem;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
  transform: translateY(-1px);
}

.password-wrapper {
  position: relative;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: var(--accent);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

.button {
  border: none;
  border-radius: 14px;
  padding: 14px 22px;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #fff;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(226, 232, 240, 0.1);
}

.button-danger {
  background: rgba(248, 113, 113, 0.15);
  color: #fee2e2;
  border: 1px solid rgba(248, 113, 113, 0.22);
}

.status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #f8fafc;
}

.status-label {
  font-size: 0.95rem;
  color: var(--muted);
}

.status-value {
  font-weight: 700;
  color: #e2e8f0;
  text-align: right;
}

.container-shell {
  display: grid;
  gap: 18px;
}

#container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(24px, 1fr));
  gap: 8px;
  min-height: 520px;
  max-height: 72vh;
  padding: 16px;
  overflow: auto;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.75);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.checkbox-wrapper {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.checkbox-wrapper:hover {
  transform: translateY(-1px);
  background: rgba(56, 189, 248, 0.12);
}

#container input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #38bdf8;
  cursor: pointer;
}

#container input[type="checkbox"][disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

.notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: min(360px, calc(100% - 48px));
  display: grid;
  gap: 12px;
  z-index: 30;
}

.project-owner-details {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 20px;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(6px);
  z-index: 40;
  text-align: center;
  color: #f8fafc;
}

.loading-overlay.hidden {
  display: none;
}

.loader {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.14);
  border-top-color: #38bdf8;
  animation: spin 0.85s linear infinite;
}

.loading-overlay span {
  font-size: 1rem;
  color: #e2e8f0;
  font-weight: 600;
}

.button:disabled,
.button[disabled] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.toast {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.18);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.32);
  animation: slideIn 0.22s ease;
}

.toast strong {
  color: #38bdf8;
  font-weight: 700;
}

.toast p {
  margin: 0;
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.45;
}

@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1080px) {
  .page-shell {
    width: min(100%, calc(100% - 32px));
  }

  .hero,
  .panel {
    padding: 24px;
  }

  .status-box {
    gap: 10px;
  }

  .button-row {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .hero {
    gap: 18px;
  }

  .hero-header {
    gap: 14px;
  }

  .auth-row {
    grid-template-columns: 1fr;
  }

  .button-row {
    justify-content: stretch;
  }

  .button {
    width: 100%;
  }

  #container {
    min-height: 480px;
  }
}

@media (max-width: 720px) {
  .hero,
  .panel {
    padding: 20px;
  }

  .auth-row {
    grid-template-columns: 1fr;
  }

  .button-row {
    justify-content: stretch;
  }

  .button {
    width: 100%;
  }

  #container {
    min-height: 420px;
    padding: 14px;
    gap: 6px;
    grid-template-columns: repeat(auto-fill, minmax(20px, 1fr));
  }

  .checkbox-wrapper {
    width: 28px;
    height: 28px;
  }

  #container input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }
}
