:root {
  color-scheme: dark;
  --text: #f1f5f9;
  --muted: rgb(255 255 255 / 0.6);
  --subtle: rgb(255 255 255 / 0.4);
  --border: rgb(255 255 255 / 0.1);
  --field: rgb(255 255 255 / 0.06);
  --field-focus: rgb(255 255 255 / 0.08);
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --blue-500: #3b82f6;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --red-300: #fca5a5;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--text);
  background: #020617;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgb(2 6 23 / 0.5), rgb(2 6 23 / 0.5)),
    url('/starting.png') center / cover no-repeat;
}

.shell {
  display: grid;
  min-height: 100svh;
}

.intro {
  display: none;
}

.intro-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.intro-brand img {
  height: 4rem;
}

.intro-text {
  max-width: 28rem;
}

.intro-text h2 {
  margin: 0 0 1rem;
  font-size: 2.25rem;
  line-height: 1.25;
  font-weight: 700;
}

.intro-text p {
  margin: 0;
  line-height: 1.625;
  color: rgb(255 255 255 / 0.7);
}

.intro-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgb(255 255 255 / 0.5);
}

.intro-status span {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--emerald-400);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.content {
  width: 100%;
  max-width: 28rem;
}

.heading {
  margin-bottom: 2rem;
  text-align: center;
}

.heading h1 {
  margin: 0 0 0.5rem;
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.heading p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.04);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.4);
  backdrop-filter: blur(24px);
  font-size: 0.875rem;
}

.panel p {
  margin: 0;
  color: var(--muted);
}

.panel .title {
  font-weight: 500;
  color: #fff;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field label {
  font-weight: 500;
  color: rgb(255 255 255 / 0.8);
}

.field .hint {
  font-size: 0.75rem;
  color: var(--subtle);
}

.field .invalid {
  font-size: 0.75rem;
  color: var(--red-300);
}

input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--field);
  color: #fff;
  font: inherit;
  outline: none;
  transition:
    border-color 0.15s,
    background-color 0.15s,
    box-shadow 0.15s;
}

input::placeholder {
  color: rgb(255 255 255 / 0.3);
}

input:focus {
  border-color: var(--indigo-400);
  background: var(--field-focus);
  box-shadow: 0 0 0 2px rgb(129 140 248 / 0.3);
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(to bottom right, var(--indigo-500), var(--blue-500));
  box-shadow: 0 10px 15px -3px rgb(99 102 241 / 0.3);
  transition:
    box-shadow 0.15s,
    opacity 0.15s;
}

.button:hover {
  box-shadow: 0 10px 15px -3px rgb(59 130 246 / 0.3);
}

.button.secondary {
  border: 1px solid var(--border);
  background: rgb(255 255 255 / 0.04);
  box-shadow: none;
  font-weight: 500;
  color: rgb(255 255 255 / 0.9);
}

.button.secondary:hover {
  background: var(--field-focus);
}

.button:disabled {
  opacity: 0.5;
  box-shadow: none;
  cursor: default;
}

.button svg {
  width: 1rem;
  height: 1rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--subtle);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.error {
  padding: 0.75rem 1rem;
  border: 1px solid rgb(252 165 165 / 0.3);
  border-radius: 0.5rem;
  background: rgb(127 29 29 / 0.3);
  color: var(--red-300);
}

.error strong {
  display: block;
  color: #fff;
  font-weight: 500;
}

.rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.125rem 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  color: var(--subtle);
}

.rules li {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.rules li::before {
  content: '○';
  width: 0.75rem;
  text-align: center;
}

.rules li.ok {
  color: var(--emerald-500);
}

.rules li.ok::before {
  content: '✓';
}

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

@media (min-width: 640px) {
  main {
    padding: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .shell {
    grid-template-columns: 1fr 1fr;
  }

  .intro {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
  }

  .heading {
    text-align: left;
  }
}
