/* ============================================================
   Nexorion Website — Dark Gaming Theme
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #0d1320;
  --bg-card: #111827;
  --bg-input: #0f1629;
  --border: #1e293b;
  --border-focus: #22d3ee;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.15);
  --accent-hover: #06b6d4;
  --accent-glow: rgba(34, 211, 238, 0.3);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.1);
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.1);
  --warning: #fbbf24;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

/* --- Utility --- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden {
  display: none !important;
}

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-brand span {
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a,
.nav-links button {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

.nav-links a {
  color: var(--text-secondary);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--accent-dim);
}

.nav-btn-primary {
  background: var(--accent) !important;
  color: var(--bg-primary) !important;
  font-weight: 600 !important;
}

.nav-btn-primary:hover {
  background: var(--accent-hover) !important;
}

.nav-btn-ghost {
  background: transparent !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
}

.nav-btn-ghost:hover {
  color: var(--text-primary) !important;
  border-color: var(--text-muted) !important;
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding-top: 64px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 50% 30%, var(--accent-glow), transparent),
    radial-gradient(ellipse 400px 300px at 20% 80%, rgba(99, 102, 241, 0.12), transparent),
    radial-gradient(ellipse 400px 300px at 80% 70%, rgba(34, 211, 238, 0.08), transparent);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  padding: 0 20px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), #818cf8, var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: var(--font);
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #ef4444;
}

.btn-lg {
  padding: 14px 36px;
  font-size: 1.1rem;
}

.btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* --- Features Section --- */
.features {
  padding: 100px 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 60px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(34, 211, 238, 0.08);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.4rem;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- Auth Pages (Login, Forgot Password, Reset Password) --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 84px 20px 40px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}

.auth-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.auth-card .subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

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

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

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-control.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-bg);
}

.form-error {
  color: var(--error);
  font-size: 0.8rem;
  margin-top: 4px;
  min-height: 1.2em;
}

.form-actions {
  margin-top: 28px;
}

.form-actions .btn {
  width: 100%;
}

.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --- Account Page --- */
.account-page {
  min-height: 100vh;
  padding: 84px 20px 40px;
}

.account-header {
  text-align: center;
  margin-bottom: 40px;
}

.account-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.account-header p {
  color: var(--text-secondary);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.account-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.account-card .card-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.profile-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.profile-field:last-child {
  border-bottom: none;
}

.profile-field .label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.profile-field .value {
  font-weight: 600;
  font-size: 0.95rem;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  min-width: 300px;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  font-size: 0.9rem;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

.toast-success {
  border-color: var(--success);
}

.toast-error {
  border-color: var(--error);
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.toast-success .toast-icon {
  background: var(--success-bg);
  color: var(--success);
}

.toast-error .toast-icon {
  background: var(--error-bg);
  color: var(--error);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* --- Footer --- */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Email Verification Step (in change-email flow) --- */
.verify-step {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.verify-step h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* --- Code Input --- */
.code-input {
  text-align: center;
  letter-spacing: 8px;
  font-size: 1.5rem;
  font-weight: 700;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .auth-card {
    padding: 28px 20px;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .nav-links {
    gap: 4px;
  }

  .nav-links a,
  .nav-links button {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .toast {
    min-width: 0;
    max-width: calc(100vw - 40px);
  }
}
