:root {
  --bg: #000000;
  --surface: rgba(22, 22, 24, 0.72);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #ffffff;
  --text-muted: rgba(235, 235, 245, 0.6);
  --text-dim: rgba(235, 235, 245, 0.35);
  --accent: #0A84FF;
  --accent-2: #5E5CE6;
  --success: #30D158;
  --danger: #FF453A;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 800px 600px at 50% -10%, rgba(10, 132, 255, 0.15), transparent 60%),
    radial-gradient(ellipse 600px 400px at 50% 120%, rgba(94, 92, 230, 0.1), transparent 60%),
    var(--bg);
}

.shell {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 48px 20px 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  justify-content: space-between;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 28px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow);
  animation: fade-up 0.6s var(--ease) both;
  overflow: hidden;
}

.glow {
  position: absolute;
  inset: -40% 0 auto 0;
  height: 280px;
  background: radial-gradient(ellipse at center, rgba(10, 132, 255, 0.45), transparent 60%);
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.logo {
  position: relative;
  z-index: 1;
  width: 88px;
  height: 88px;
  border-radius: 22px;
  margin-bottom: 24px;
  animation: pop-in 0.7s var(--ease) both;
  animation-delay: 0.1s;
}

.title {
  position: relative;
  z-index: 1;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  animation: fade-up 0.7s var(--ease) both;
  animation-delay: 0.15s;
}

.subtitle {
  position: relative;
  z-index: 1;
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 32px;
  animation: fade-up 0.7s var(--ease) both;
  animation-delay: 0.2s;
}

.actions {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fade-up 0.7s var(--ease) both;
  animation-delay: 0.25s;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, opacity 0.2s;
  user-select: none;
}

.btn:focus-visible {
  outline: 2px solid rgba(10, 132, 255, 0.7);
  outline-offset: 2px;
}

.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px -10px rgba(10, 132, 255, 0.6);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-link {
  background: transparent;
  min-height: 44px;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-link:hover {
  color: var(--text);
}

.icon {
  flex-shrink: 0;
}

.email-form {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  animation: fade-up 0.4s var(--ease) both;
}

.email-form.hidden {
  display: none;
}

.input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  letter-spacing: -0.01em;
  transition: border-color 0.2s, background 0.2s;
}

.input::placeholder {
  color: var(--text-dim);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.hint {
  font-size: 13px;
  color: var(--text-muted);
  text-align: left;
  padding: 0 4px;
}

.status {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  min-height: 20px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}

.spinner {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  margin: 20px auto 12px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.spinner.hidden {
  display: none;
}

.actions.hidden {
  display: none;
}

.foot {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.foot a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.foot a:hover, .foot a:focus-visible {
  color: var(--text);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

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

@media (max-width: 380px) {
  .card { padding: 40px 20px 28px; }
  .title { font-size: 28px; }
  .subtitle { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
