/* ════════════════════════════════════════════════════════════════════
   nexaapp.tv — shared stylesheet
   Tokens first, then atoms, then components, then page-specific.
   Every HTML file loads this; inline <style> is only for page-unique overrides.
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* Brand palette — purple→cyan gradient keeps the existing visual DNA */
  --bg:           #08080f;
  --surface:      #0f0f1a;
  --surface-2:    #141425;
  --border:       #1e1e35;
  --border-hover: #2a2a4a;

  --accent:       #a855f7;     /* primary purple */
  --accent-deep:  #7c3aed;
  --accent-2:     #06b6d4;     /* secondary cyan */
  --accent-2-deep:#0891b2;

  --text:         #e8e8f0;
  --muted:        #8888a0;
  --dim:          #555570;

  --good:         #22c55e;
  --warn:         #eab308;
  --bad:          #ef4444;

  /* Radii + motion */
  --radius-sm: 8px;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 10px rgba(0,0,0,.2);
  --shadow-lg: 0 20px 60px -20px rgba(168,85,247,.3);

  /* Content widths */
  --max-content: 1100px;
  --max-narrow:  520px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

a { color: var(--accent); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: 0.8; }

/* ─── Navigation bar (shared across every page) ─────────────────── */

.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 40px;
  height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(8, 8, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.nav-brand {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-decoration: none;
}
.nav-brand:hover { opacity: 1; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); opacity: 1; }
.nav-cta {
  background: var(--accent);
  color: white !important;
  padding: 8px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background 0.2s, transform 0.1s;
}
.nav-cta:hover { background: var(--accent-deep); opacity: 1; transform: translateY(-1px); }

@media (max-width: 768px) {
  .nav { padding: 0 20px; }
  .nav-links a:not(.nav-cta) { display: none; }
}

/* Push content below the fixed nav */
.page { padding-top: 68px; }

/* ─── Buttons ───────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: white;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(168, 85, 247, 0.3);
  opacity: 1;
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(168, 85, 247, 0.05);
  opacity: 1;
}

.btn-block { width: 100%; }

/* ─── Auth card (login, register, forgot, reset, welcome) ───────── */

.auth-shell {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}
.auth-shell::before {
  content: '';
  position: absolute;
  top: -300px; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(168,85,247,0.10) 0%, transparent 60%);
  pointer-events: none;
}

.card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-sm);
}
.card--wide { max-width: 560px; }

.card-header {
  text-align: center;
  margin-bottom: 32px;
}
.card-header h1 {
  font-size: 1.7rem;
  margin-bottom: 6px;
}
.card-header p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ─── Forms ─────────────────────────────────────────────────────── */

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}
.form-group input::placeholder { color: var(--dim); }

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--dim);
}

.form-error,
.error {
  display: none;
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.form-error.active,
.error.active { display: block; }

.form-success {
  padding: 12px 14px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  color: #86efac;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.links {
  text-align: center;
  margin-top: 24px;
  font-size: 0.88rem;
  color: var(--muted);
}
.links p { margin-bottom: 8px; }
.links a { color: var(--accent); font-weight: 500; }

/* ─── Hero ──────────────────────────────────────────────────────── */

.hero {
  min-height: calc(100vh - 68px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 80px 24px 100px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 900px;
  background: radial-gradient(circle, rgba(168,85,247,0.12) 0%, rgba(6,182,212,0.05) 40%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 32px;
  letter-spacing: 0.3px;
}
.hero-badge span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}
.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800;
  max-width: 840px;
  margin-bottom: 24px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 40px;
}
.hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 768px) {
  .hero { padding: 60px 20px 80px; }
  .hero h1 { font-size: 2.4rem; }
}

/* ─── Sections ──────────────────────────────────────────────────── */

.section {
  padding: 100px 24px;
  position: relative;
}
.section-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  text-align: center;
  margin-bottom: 16px;
}
.section-sub {
  color: var(--muted);
  text-align: center;
  max-width: 560px;
  margin: 0 auto 56px;
  font-size: 1.02rem;
}

.container { max-width: var(--max-content); margin: 0 auto; }
.container-narrow { max-width: 680px; margin: 0 auto; }

.surface-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ─── Feature grid ──────────────────────────────────────────────── */

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

.feature-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform 0.2s, border-color 0.2s;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 85, 247, 0.3);
}
.feature-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.feature-icon.purple { background: rgba(168, 85, 247, 0.12); }
.feature-icon.cyan   { background: rgba(6, 182, 212, 0.12); }
.feature-icon.amber  { background: rgba(245, 158, 11, 0.12); }
.feature-icon.green  { background: rgba(52, 211, 153, 0.12); }
.feature-icon.pink   { background: rgba(236, 72, 153, 0.12); }
.feature-icon.blue   { background: rgba(59, 130, 246, 0.12); }
.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}
.feature-card p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ─── App grid (Downloads section) ──────────────────────────────── */

.app-category {
  margin-bottom: 64px;
}
.app-category:last-child { margin-bottom: 0; }
.app-category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 4px;
}
.app-category-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
}
.app-category-header .count {
  color: var(--dim);
  font-size: 0.82rem;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.app-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}
.app-card:hover {
  transform: translateY(-3px);
  border-color: rgba(168, 85, 247, 0.3);
}

.app-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.app-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.2);
}
.app-icon svg { width: 28px; height: 28px; }
.app-info { flex: 1; min-width: 0; }
.app-info h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
  line-height: 1.3;
}
.app-info .app-platform {
  font-size: 0.78rem;
  color: var(--dim);
}

.app-desc {
  color: var(--muted);
  font-size: 0.85rem;
  flex: 1;
  margin-bottom: 16px;
  line-height: 1.5;
}

.app-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.app-cta.available {
  background: var(--accent);
  color: white;
}
.app-cta.available:hover { background: var(--accent-deep); opacity: 1; transform: translateY(-1px); }
.app-cta.coming-soon {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--dim);
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Steps list ────────────────────────────────────────────────── */

.steps {
  max-width: 800px;
  margin: 0 auto;
  display: flex; flex-direction: column;
}
.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 24px 0;
  position: relative;
}
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 23px; top: 68px; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, rgba(168,85,247,0.3), rgba(168,85,247,0.05));
}
.step-num {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.step-content h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.step-content p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ─── CTA section ───────────────────────────────────────────────── */

.cta-section {
  text-align: center;
  padding: 120px 24px;
  position: relative;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 700px; height: 400px;
  background: radial-gradient(circle, rgba(168,85,247,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.cta-section h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 16px;
}
.cta-section p {
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 36px;
  font-size: 1.02rem;
}

/* ─── Footer ────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 56px 24px 32px;
  background: var(--surface);
}
.footer-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand .nav-brand {
  font-size: 1.3rem;
  margin-bottom: 12px;
  display: inline-block;
}
.footer-brand p {
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 320px;
  line-height: 1.6;
}
.footer-col h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
  color: var(--text);
  font-size: 0.88rem;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.footer-col a:hover { opacity: 1; }

.footer-bottom {
  max-width: var(--max-content);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-copy {
  color: var(--dim);
  font-size: 0.82rem;
}
.footer-disclaimer {
  color: var(--dim);
  font-size: 0.75rem;
  max-width: 480px;
  text-align: right;
}

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-disclaimer { text-align: center; }
}

/* ─── Legal pages (privacy, terms) ──────────────────────────────── */

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}
.legal h1 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}
.legal .updated {
  color: var(--dim);
  font-size: 0.85rem;
  margin-bottom: 32px;
}
.legal h2 {
  font-size: 1.25rem;
  margin-top: 32px;
  margin-bottom: 12px;
}
.legal h3 {
  font-size: 1.05rem;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text);
}
.legal p, .legal li {
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.legal ul, .legal ol {
  padding-left: 20px;
  margin-bottom: 16px;
}
.legal a { color: var(--accent); }

/* ─── Profile page (signed-in dashboard) ────────────────────────── */

.profile-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}
.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 16px;
}
.profile-header h1 {
  font-size: 1.8rem;
}
.profile-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}
.profile-section h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.profile-section .section-desc {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.server-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.server-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.server-dot.online  { background: var(--good);  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
.server-dot.offline { background: var(--dim); }
.server-meta {
  font-size: 0.78rem;
  color: var(--dim);
  margin-top: 2px;
  word-break: break-all;
}
.server-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.server-badge.owner  { background: rgba(168, 85, 247, 0.15); color: var(--accent); }
.server-badge.member { background: rgba(6, 182, 212, 0.15); color: var(--accent-2); }

/* ─── Utility ───────────────────────────────────────────────────── */

.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0  { margin-bottom: 0; }
.hidden { display: none !important; }
