@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================
   DESIGN TOKENS
============================================ */
:root {
  --brand: #f97316;
  --brand-dark: #ea6000;
  --brand-light: #fed7aa;
  --brand-glow: rgba(249, 115, 22, 0.35);

  --bg: #0a0a0f;
  --bg-2: #111118;
  --bg-3: #1a1a24;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(249,115,22,0.4);

  --text: #f8f8ff;
  --text-muted: #8888a8;
  --text-faint: #44445a;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-brand: 0 8px 32px rgba(249,115,22,0.25);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET
============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { 
  scroll-behavior: smooth; 
  overflow-x: hidden; 
  width: 100%;
}
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, textarea, select { font-family: inherit; outline: none; }

/* ============================================
   SCROLLBAR
============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--brand); border-radius: 99px; }

/* ============================================
   TYPOGRAPHY
============================================ */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.2; }

/* ============================================
   BUTTONS
============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(249,115,22,0.06);
}
.btn-ghost {
  background: var(--surface);
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--surface-hover);
}
.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: var(--radius); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ============================================
   FORM ELEMENTS
============================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text);
  transition: var(--transition);
  width: 100%;
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
  background: var(--bg-2);
}
.form-input::placeholder { color: var(--text-faint); }
.form-input.error { border-color: #ef4444; }

/* ============================================
   GLASS CARD
============================================ */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ============================================
   BADGE
============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(249,115,22,0.15);
  color: var(--brand);
  border: 1px solid rgba(249,115,22,0.3);
}

/* ============================================
   TOAST NOTIFICATION
============================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInToast 0.3s ease;
  max-width: 320px;
}
.toast-success { background: #166534; border: 1px solid #22c55e; color: #bbf7d0; }
.toast-error   { background: #7f1d1d; border: 1px solid #ef4444; color: #fecaca; }
.toast-info    { background: #1e3a5f; border: 1px solid var(--brand); color: var(--brand-light); }
@keyframes slideInToast {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================
   NAV
============================================ */
.nav {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: 5000 !important;
  padding: 12px 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
  max-width: 100vw;
  overflow: hidden;
}
.nav-logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  flex-shrink: 0;
  white-space: nowrap;
}
.nav-logo span { color: var(--brand); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================
   LOADER
============================================ */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 768px) {
  .nav { padding: 10px 12px; }
  .nav-links { gap: 8px; }
  .nav-links a.btn-ghost { display: none; }
  .nav-links a.btn-outline { display: flex; }
  .nav-logo { font-size: 16px; }
  .nav-logo span + span { display: none; } /* Hide 'Editor' text if it's in a span */
  #user-name { display: none !important; }
  
  .nav-links .btn-primary, .nav-links .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
  }
  .plan-badge {
    padding: 4px 8px;
    font-size: 10px;
    gap: 4px;
  }
  .cta-full { display: none !important; }
  .cta-short { display: inline !important; }
  
  .btn-lg { padding: 14px 20px; font-size: 15px; }
}

/* LEGAL PAGES RESPONSIVE */
@media (max-width: 768px) {
  .legal-page { padding: 80px 16px 40px !important; }
  .legal-title { font-size: 28px !important; }
}

/* UTILS */
.hidden { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }

