:root {
  --bg: #050505;
  --panel: rgba(12, 12, 12, 0.92);
  --panel-soft: rgba(20, 20, 20, 0.9);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f7fb;
  --muted: #9ca3af;
  --accent: #ffffff;
  --danger: #fb7185;
  --success: #86efac;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  --radius-xl: 28px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.07), transparent 18%),
    linear-gradient(180deg, #020202 0%, #090909 100%);
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 12px;
}

.panel {
  width: min(640px, 100%);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.panel-header,
.form-shell {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
}

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

.panel-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

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

.brand-logo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.4);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-copy strong {
  font-size: 18px;
  letter-spacing: -0.03em;
}

.brand-copy span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-header h1 {
  margin: 0 0 10px;
  font-size: clamp(18px, 2.5vw, 26px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.intro {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.notice {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.notice h2 {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.notice ol,
.notice p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.notice ol {
  padding-left: 20px;
}

.notice li + li {
  margin-top: 8px;
}

.notice p {
  margin-top: 16px;
}

.form-shell {
  padding: 16px;
}

.app-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.field span,
.field-line {
  color: #f3f4f6;
  font-size: 13px;
  font-weight: 600;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  background: #0a0a0a;
  color: var(--text);
  padding: 13px 14px;
  outline: none;
  transition: 0.25s ease;
  font: inherit;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #6b7280;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
  transform: translateY(-1px);
}

.field textarea {
  resize: vertical;
  min-height: 108px;
}

.field-full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
}

.submit-button,
.ghost-button {
  position: relative;
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s ease;
}

.submit-button {
  min-width: 180px;
  color: #0b0b0b;
  background: linear-gradient(180deg, #ffffff 0%, #d4d4d8 100%);
  box-shadow: 0 18px 40px rgba(255, 255, 255, 0.12);
}

.submit-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.submit-button.loading .button-label {
  opacity: 0;
}

.button-loader {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.16);
  border-top-color: #111111;
  opacity: 0;
  animation: spin 0.8s linear infinite;
}

.submit-button.loading .button-loader {
  opacity: 1;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.form-message.success {
  color: var(--success);
}

.success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 30px 14px 12px;
}

.success-state h2 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.success-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hidden {
  display: none;
}

.success-spinner {
  position: relative;
  width: 110px;
  height: 110px;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08);
}

.spinner-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border-top: 3px solid #ffffff;
  border-right: 3px solid transparent;
  animation: spin 1.4s linear infinite;
}

.spinner-ring-second::after {
  inset: 20px;
  border-top-color: #9ca3af;
  animation-duration: 1s;
  animation-direction: reverse;
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.07), transparent 18%),
    linear-gradient(180deg, #020202 0%, #090909 100%);
  animation: preloaderFade 1.5s ease forwards;
}

.preloader-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: #ffffff;
  animation: spin 0.9s linear infinite;
}

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

@keyframes preloaderFade {
  0%,
  78% {
    opacity: 1;
    visibility: visible;
  }

  100% {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 14px;
  }

  .panel {
    padding: 16px;
    border-radius: 24px;
  }

  .panel-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .submit-button,
  .ghost-button {
    width: 100%;
  }
}
