/* ── Design Tokens (matching admin dashboard) ── */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a26;
  --bg-card: #14141e;
  --bg-hover: #22222f;
  --border: #2a2a3a;
  --border-hover: #3a3a50;
  --accent: #6c5ce7;
  --accent-hover: #7c6cf7;
  --accent-glow: rgba(108, 92, 231, 0.15);
  --text-primary: #e8e8f0;
  --text-secondary: #8888a0;
  --text-muted: #555570;
  --red: #ff6b6b;
  --red-bg: rgba(255, 107, 107, 0.1);
  --green: #00d68f;
  --green-bg: rgba(0, 214, 143, 0.1);
}

/* ── Base ── */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(108, 92, 231, 0.08) 0%, transparent 60%),
    var(--bg-primary);
}

/* ── Auth Form Card ── */
.auth-form {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
}

.auth-form::before {
  content: '';
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
}

.auth-form h1 {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 24px;
  color: var(--text-primary);
}

.auth-form form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.auth-form input::placeholder {
  color: var(--text-muted);
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-form button {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.auth-form button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.auth-form button:active {
  transform: translateY(0);
}

.auth-form button.secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.auth-form button.secondary:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.auth-form p {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 8px 0;
}

/* ── Links ── */
.button-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--text-secondary);
  text-decoration: none;
  text-align: center;
  width: 100%;
  font-size: 0.9rem;
  transition: color 0.15s;
}

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

/* ── Helper text ── */
.alt-option,
.hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── Error Message ── */
.error-message {
  background: var(--red-bg);
  color: var(--red);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 107, 107, 0.2);
  font-size: 0.9rem;
}

/* ── Index / Hero Card ── */
.hero {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
}

.hero::before {
  content: '';
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
}

.hero h1 {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 16px;
  color: var(--text-primary);
}

.hero p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 16px;
}

.hero ul {
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hero li {
  margin-bottom: 6px;
}

/* ── Error Page ── */
.error {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  text-align: center;
}

.error::before {
  content: '';
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--red), #ff8787);
}

.error h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--red);
  margin: 0 0 12px;
}

.error p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

/* ── Profile Selection ── */
.profile-selection .subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.profile-option {
  cursor: pointer;
  display: block;
}

.profile-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s ease;
  background: var(--bg-tertiary);
}

.profile-option input[type="radio"]:checked + .profile-card {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.profile-option:hover .profile-card {
  border-color: var(--border-hover);
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}

.profile-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.profile-universe {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.profile-active-badge {
  display: inline-block;
  background: var(--green-bg);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 12px;
  width: fit-content;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .auth-form,
  .hero,
  .error {
    padding: 32px 24px;
    border-radius: 16px;
  }
}
