*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #030a12;
  --surface: rgba(7, 19, 31, 0.8);
  --surface-border: rgba(6, 182, 212, 0.24);
  --text: #e6f7ff;
  --muted: rgba(199, 228, 238, 0.78);
  --accent: #67e8f9;
  --accent-2: #0284c7;
  --input-bg: rgba(4, 14, 24, 0.74);
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.14);
  --ok: #22d3ee;
  --ok-bg: rgba(34, 211, 238, 0.14);
}

:root[data-theme='light'] {
  --bg: #f4fbff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-border: rgba(14, 116, 144, 0.2);
  --text: #123042;
  --muted: rgba(18, 48, 66, 0.74);
  --accent: #0e7490;
  --accent-2: #0369a1;
  --input-bg: rgba(246, 253, 255, 0.92);
  --error: #dc2626;
  --error-bg: rgba(220, 38, 38, 0.12);
  --ok: #0e7490;
  --ok-bg: rgba(14, 116, 144, 0.12);
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  z-index: 0;
  pointer-events: none;
}

.orb-a {
  left: -180px;
  top: -140px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
}

.orb-b {
  right: -170px;
  bottom: -180px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 50%, #000 25%, transparent 100%);
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 0.46rem 0.84rem;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.card {
  width: 100%;
  max-width: 620px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  border-radius: 22px;
  padding: 2rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 44px rgba(2, 9, 19, 0.35);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.logo-wrap { margin-bottom: 0; }
.logo { height: 58px; width: auto; }
.logo-light { display: none; }
:root[data-theme='light'] .logo-dark { display: none; }
:root[data-theme='light'] .logo-light { display: inline-block; }

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.back-link:hover { color: var(--accent); }

.back-link-inline {
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  background: rgba(6, 182, 212, 0.06);
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 0.34rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  color: var(--accent);
  background: rgba(6, 182, 212, 0.08);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 0.95rem;
}

.title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.7rem;
}

.copy {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.75;
  margin-bottom: 1.4rem;
}

.form { width: 100%; }
.label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.row {
  display: flex;
  gap: 0.6rem;
}

.input {
  flex: 1;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: var(--input-bg);
  color: var(--text);
  padding: 0.82rem 1rem;
  font-size: 0.94rem;
  outline: none;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 0.82rem 1rem;
  color: #f7feff;
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-2) 0%, #06b6d4 50%, #6366f1 100%);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.34);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
}

.helper {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.prefilled-link {
  display: inline-block;
  margin-top: 0.25rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

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

.error {
  margin-top: 0.75rem;
  min-height: 1.2em;
  color: var(--error);
  font-size: 0.83rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: transparent;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.error.visible {
  background: var(--error-bg);
  opacity: 1;
}

.success {
  margin-top: 0.75rem;
  color: var(--ok);
  font-size: 0.84rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  background: var(--ok-bg);
}

.success[hidden] { display: none !important; }

@media (max-width: 640px) {
  .card { padding: 1.2rem; }
  .row { flex-direction: column; }
  .btn { width: 100%; }
  .card-top {
    flex-direction: column;
    align-items: flex-start;
  }
}
