:root {
  --bg-deep: #040a06;
  --surface: rgba(10, 24, 15, 0.78);
  --surface-hover: rgba(16, 36, 24, 0.85);
  --surface-input: rgba(5, 14, 9, 0.92);
  --border: rgba(140, 210, 90, 0.18);
  --border-strong: rgba(168, 232, 92, 0.55);
  --text: #f8fff9;
  --text-muted: #8fa898;
  --accent: #72c83e;
  --accent-bright: #b8f06a;
  --accent-soft: rgba(111, 191, 58, 0.14);
  --accent-glow: rgba(120, 200, 70, 0.45);
  --success: #d4ff7a;
  --error: #ff9aa1;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  position: relative;
  overflow-x: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #08140c 0%, #040a06 55%, #030805 100%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.bg-orb--1 {
  width: 420px;
  height: 420px;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(111, 191, 58, 0.22);
}

.bg-orb--2 {
  width: 280px;
  height: 280px;
  bottom: 10%;
  right: -80px;
  background: rgba(79, 140, 45, 0.12);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(168, 232, 92, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 232, 92, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent);
}

.page {
  max-width: 440px;
  margin: 0 auto;
  padding: 2.75rem 1.25rem 2.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  text-align: center;
  margin-bottom: 2.25rem;
}

.brand-link {
  display: inline-flex;
  text-decoration: none;
  border-radius: 50%;
  margin-bottom: 1.1rem;
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.brand-link:hover {
  transform: scale(1.04);
}

.brand-link:hover .brand-ring {
  box-shadow:
    0 0 0 1px rgba(168, 232, 92, 0.45),
    0 14px 44px rgba(0, 0, 0, 0.5),
    0 0 72px rgba(111, 191, 58, 0.28);
}

.brand-link:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 4px;
}

.brand-ring {
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(168, 232, 92, 0.7), rgba(79, 130, 45, 0.5));
  box-shadow:
    0 0 0 1px rgba(168, 232, 92, 0.25),
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(111, 191, 58, 0.15);
}

.brand-logo {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.1);
}

.logo {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
}

.logo span {
  color: var(--accent-bright);
  text-shadow: 0 0 40px rgba(184, 240, 106, 0.35);
}

.tagline {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.back-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--accent-bright);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.back-link:hover {
  text-decoration: underline;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    145deg,
    rgba(184, 240, 106, 0.35),
    transparent 40%,
    transparent 60%,
    rgba(111, 191, 58, 0.15)
  );
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

.card-main {
  padding: 1.65rem 1.55rem 1.55rem;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.card-head h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.card-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
}

.card-info {
  padding: 1.35rem 1.4rem 1.25rem;
}

.info-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.info-item {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  column-gap: 0.9rem;
  align-items: start;
}

.info-text {
  min-width: 0;
  padding-top: 0.05rem;
}

.info-item strong {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  line-height: 1.35;
}

.info-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
}

.info-num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  margin-top: 0.12rem;
  user-select: none;
}

.matched-login {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-bright);
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.75rem;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.server-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.15rem 0.45rem;
  background: var(--accent-soft);
  color: var(--accent-bright);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid var(--border);
  vertical-align: middle;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.card h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-title {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-bright);
  margin-bottom: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field-hint {
  margin-top: 0.45rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.input-wrap {
  position: relative;
  margin-bottom: 0;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(184, 240, 106, 0.45);
  font-size: 1rem;
  font-weight: 700;
  pointer-events: none;
  user-select: none;
}

.input {
  width: 100%;
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.95rem 1rem 0.95rem 2.35rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-single {
  resize: none;
  margin-bottom: 0;
}

.input::placeholder {
  color: rgba(156, 184, 164, 0.55);
}

.input:focus {
  outline: none;
  border-color: var(--border-strong);
  background: rgba(10, 24, 16, 0.95);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.btn {
  display: inline-block;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  width: 100%;
  margin-top: 0.15rem;
  background: linear-gradient(180deg, #c8f87a 0%, #6fbf3a 100%);
  color: #061008;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 12px 32px rgba(90, 160, 50, 0.4);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 14px 36px rgba(100, 180, 55, 0.5);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: wait;
}

.btn-secondary {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.btn-secondary:hover {
  border-color: var(--border-strong);
}

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(255, 138, 146, 0.4);
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.error {
  background: rgba(255, 100, 110, 0.1);
  border: 1px solid rgba(255, 138, 146, 0.35);
  color: #ffc4c8;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-top: 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.message {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.ok {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent-bright);
}

.message.err {
  background: rgba(255, 100, 110, 0.1);
  border: 1px solid rgba(255, 138, 146, 0.35);
  color: #ffc4c8;
}

.hidden {
  display: none !important;
}

.result {
  margin-top: 1.65rem;
  text-align: center;
  padding-top: 1.65rem;
  border-top: 1px solid var(--border);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.result--visible {
  opacity: 1;
  transform: translateY(0);
}

.result-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.9rem;
}

.code {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, rgba(6, 16, 10, 0.95), rgba(3, 10, 6, 0.98));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--success);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.32em;
  padding: 1.15rem 0.5rem;
  cursor: pointer;
  font-family: "Cascadia Code", "Consolas", monospace;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  text-shadow: 0 0 40px rgba(212, 255, 122, 0.35);
  box-shadow:
    0 0 60px rgba(111, 191, 58, 0.1) inset,
    0 8px 32px rgba(0, 0, 0, 0.3);
}

.code--pulse {
  animation: codePulse 0.6s ease;
}

@keyframes codePulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.02); box-shadow: 0 0 80px rgba(111, 191, 58, 0.25) inset; }
  100% { transform: scale(1); }
}

.code:hover {
  border-color: var(--accent-bright);
  box-shadow:
    0 0 40px rgba(111, 191, 58, 0.12) inset,
    0 0 24px var(--accent-glow);
}

.hint-tap {
  margin-top: 0.65rem;
  font-size: 0.76rem;
  color: rgba(143, 168, 152, 0.85);
}

.timer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timer-text strong {
  color: var(--accent-bright);
  font-weight: 700;
}

.footer {
  text-align: center;
  color: rgba(143, 168, 152, 0.7);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--accent-bright);
  text-decoration: none;
  transition: opacity 0.2s;
}

.footer-link:hover {
  opacity: 0.85;
  text-decoration: underline;
}

.footer-dot {
  opacity: 0.4;
}

.timer-wrap {
  margin-top: 1.35rem;
}

.timer-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: 999px;
  width: 100%;
  transition: width 1s linear;
  box-shadow: 0 0 12px var(--accent-glow);
}

.hint {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.instructions code,
.hint-block code {
  background: rgba(0, 0, 0, 0.25);
  color: var(--accent-bright);
  padding: 0.12rem 0.38rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-family: "Cascadia Code", "Consolas", monospace;
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #b8f06a, #7bc93f);
  color: #0a1608;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 8px 30px var(--accent-glow);
  z-index: 100;
}

.form-grid {
  display: grid;
  gap: 0;
}

.hint-block {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.accounts-list {
  margin-top: 1rem;
}

.account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.account-item:last-child {
  border-bottom: none;
}

.account-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.admin-header-row h1 {
  margin-bottom: 0;
}

.btn-small {
  width: auto;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .page {
    padding-top: 2rem;
  }

  .brand-logo {
    width: 76px;
    height: 76px;
  }

  .logo {
    font-size: 1.85rem;
  }

  .code {
    font-size: 1.9rem;
    letter-spacing: 0.2em;
    padding: 1rem 0.35rem;
  }

  .card-main {
    padding: 1.5rem 1.25rem 1.35rem;
  }
}
