/* =============================================================
   GhostLink Auth & Onboarding Styles
   Dark glassmorphism, neon violet accent — matches landing page
   ============================================================= */

:root {
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --accent-hover: #6d28d9;
  --surface: rgba(18, 10, 35, 0.85);
  --surface-border: rgba(124, 58, 237, 0.25);
  --text: #e8e0f5;
  --text-muted: #888;
  --input-bg: rgba(255, 255, 255, 0.05);
  --input-border: rgba(124, 58, 237, 0.3);
  --input-focus: rgba(124, 58, 237, 0.7);
  --error-bg: rgba(239, 68, 68, 0.12);
  --error-border: rgba(239, 68, 68, 0.4);
  --error-text: #fca5a5;
  --success-bg: rgba(34, 197, 94, 0.12);
  --success-border: rgba(34, 197, 94, 0.4);
  --success-text: #86efac;
}

.auth-body {
  min-height: 100vh;
  background: #07040f;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124, 58, 237, 0.25) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 90%, rgba(139, 92, 246, 0.12) 0%, transparent 60%);
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Nav ── */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(7, 4, 15, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

.nav-logo { margin-bottom: 0; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  color: #ccc;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-link:hover, .nav-active { color: var(--accent-light); }

.nav-link-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #ccc;
  padding: 0;
  transition: color 0.15s;
}
.nav-link-btn:hover { color: var(--error-text); }

/* ── Container ── */
.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-logo {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 32px;
  display: inline-block;
  letter-spacing: -0.3px;
}
.auth-logo:hover { color: var(--accent-light); }

/* ── Card ── */
.auth-card {
  width: 100%;
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(124, 58, 237, 0.1);
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #f0eaff;
  letter-spacing: -0.4px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 28px;
  line-height: 1.5;
}

/* ── Feedback ── */
.auth-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.4;
}

.auth-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.4;
}

.auth-notice {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: var(--accent-light);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.4;
}

/* ── Form ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 13px;
  font-weight: 600;
  color: #b8a8d8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-optional {
  font-weight: 400;
  color: var(--text-muted);
}

.field-link {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 400;
}
.field-link:hover { text-decoration: underline; }

.auth-input {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  width: 100%;
  box-sizing: border-box;
}
.auth-input::placeholder { color: #555; }
.auth-input:focus {
  border-color: var(--input-focus);
  background: rgba(124, 58, 237, 0.06);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.password-wrap {
  position: relative;
  display: flex;
}
.password-wrap .auth-input { padding-right: 42px; }

.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.pw-toggle:hover { color: var(--accent-light); }

.field-validation {
  font-size: 12px;
  min-height: 16px;
  display: block;
  transition: color 0.2s;
}
.field-validation.valid { color: #86efac; }
.field-validation.invalid { color: var(--error-text); }

/* ── Button ── */
.auth-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-decoration: none;
  text-align: center;
  display: block;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
  letter-spacing: -0.1px;
  margin-top: 4px;
}
.auth-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.5);
  transform: translateY(-1px);
}
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid var(--surface-border);
  box-shadow: none;
  color: var(--accent-light);
}
.btn-secondary:hover {
  background: rgba(124, 58, 237, 0.25);
  box-shadow: none;
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--error-text);
  border-radius: 8px;
  padding: 9px 16px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger-outline:hover { background: rgba(239, 68, 68, 0.1); }

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: #444;
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(124, 58, 237, 0.15);
}

/* ── Social buttons ── */
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 16px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 10px;
  position: relative;
}
.social-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.social-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.coming-soon-badge {
  position: absolute;
  right: 14px;
  background: rgba(124, 58, 237, 0.25);
  color: var(--accent-light);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Footer ── */
.auth-footer {
  text-align: center;
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-footer a { color: var(--accent-light); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Stepper ── */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
  width: 100%;
  max-width: 220px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid #333;
  color: #555;
  background: transparent;
  transition: all 0.3s;
}

.step.active .step-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.5);
}

.step.completed .step-dot {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}

.step-label {
  font-size: 11px;
  color: #555;
  font-weight: 500;
}
.step.active .step-label { color: var(--accent-light); }
.step.completed .step-label { color: #86efac; }

.step-line {
  width: 48px;
  height: 2px;
  background: #222;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.step-line-done { background: #22c55e; }

/* ── Onboarding card ── */
.onboarding-card { max-width: 440px; }

/* ── Username input ── */
.username-input-wrap {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.username-input-wrap:focus-within {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.username-prefix {
  padding: 11px 8px 11px 14px;
  color: var(--accent-light);
  font-size: 16px;
  font-weight: 700;
  user-select: none;
}

.username-input {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding-left: 4px !important;
  box-shadow: none !important;
}
.username-input:focus { box-shadow: none !important; }

.username-rules {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.rule {
  font-size: 11px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}
.rule-ok { color: #86efac; }
.rule-fail { color: var(--error-text); }

/* ── Avatar picker ── */
.avatar-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 16px 0 24px;
}

.avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.12);
  border: 2px solid rgba(124, 58, 237, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #666;
}

.avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-placeholder {
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid var(--surface-border);
  color: var(--accent-light);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Inter', -apple-system, sans-serif;
  cursor: pointer;
  transition: background 0.15s;
}
.avatar-pick-btn:hover { background: rgba(124, 58, 237, 0.25); }

.hidden-input { display: none; }

.file-name-label {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
  text-align: center;
}

.skip-btn {
  background: none;
  border: none;
  color: #555;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  display: block;
  margin: 12px auto 0;
  padding: 4px 8px;
  transition: color 0.15s;
}
.skip-btn:hover { color: #888; }

/* ── Profile page ── */
.profile-card {
  padding: 32px;
  max-width: 480px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(124, 58, 237, 0.4);
  flex-shrink: 0;
}

.profile-avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.2);
  border: 2px solid rgba(124, 58, 237, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-light);
  flex-shrink: 0;
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #f0eaff;
}

.profile-username {
  font-size: 14px;
  color: var(--accent-light);
  margin: 0 0 2px;
}

.profile-email {
  font-size: 13px;
  color: #666;
  margin: 0;
}

.profile-section {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
}
.profile-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #666;
  margin: 0 0 16px;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Privacy toggle */
.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-text strong {
  font-size: 14px;
  color: var(--text);
}

.toggle-text small {
  font-size: 12px;
  color: #666;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #333;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(20px); }

/* Sessions */
.sessions-list { display: flex; flex-direction: column; gap: 10px; }

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px 14px;
}

.session-current {
  border-color: rgba(124, 58, 237, 0.3);
  background: rgba(124, 58, 237, 0.05);
}

.session-device {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.session-badge {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.session-meta {
  font-size: 11px;
  color: #555;
}

.session-revoke-btn {
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', -apple-system, sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.session-revoke-btn:hover { background: rgba(239, 68, 68, 0.1); }

/* ── Mobile ── */
@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; border-radius: 16px; }
  .auth-title { font-size: 20px; }
  .profile-header { flex-direction: column; align-items: flex-start; }
}
