/* ══════════════════════════════════════════════════
   AudiAI — Design System
   Paleta: Deep navy + Electric indigo + Soft white + Amber accent
   Tipografia: Syne (display) + Inter (body)
══════════════════════════════════════════════════ */

:root {
  --navy:       #0D0F1A;
  --navy-mid:   #161929;
  --navy-light: #1E2235;
  --indigo:     #5B4EFF;
  --indigo-glow:#7B6FFF;
  --amber:      #F5A623;
  --white:      #F4F5FF;
  --muted:      #8890B0;
  --border:     rgba(255,255,255,0.07);
  --success:    #22C55E;
  --danger:     #EF4444;
  --warning:    #F59E0B;
  --info:       #3B82F6;

  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 32px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--indigo-glow); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--white); }

/* ── Brand Logo ──────────────────────────────── */
.brand-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--white);
  letter-spacing: -0.03em;
}
.brand-logo span { color: var(--indigo-glow); }

/* ── Toast Notifications ─────────────────────── */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 360px;
  animation: slideIn 0.3s ease;
}
.toast--success  { background: var(--success); color: #fff; }
.toast--danger   { background: var(--danger);  color: #fff; }
.toast--warning  { background: var(--warning); color: #000; }
.toast--info     { background: var(--info);    color: #fff; }

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

/* ── Auth Layout ─────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(ellipse at 60% 0%, rgba(91,78,255,0.15) 0%, transparent 60%),
              var(--navy);
}

.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}
.brand-tagline {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

.auth-card {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  color: var(--white);
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ── Form Fields ─────────────────────────────── */
.field {
  margin-bottom: 1.25rem;
}
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: border-color var(--transition);
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(91,78,255,0.15);
}
.field input::placeholder { color: rgba(255,255,255,0.25); }

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}
.btn--primary {
  background: var(--indigo);
  color: #fff;
}
.btn--primary:hover {
  background: var(--indigo-glow);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(91,78,255,0.4);
}
.btn--secondary {
  background: var(--navy-light);
  color: var(--white);
  border: 1px solid var(--border);
}
.btn--secondary:hover { border-color: var(--indigo); color: var(--white); }
.btn--full { width: 100%; }

/* ── App Layout (Dashboard) ──────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--navy-mid);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand-logo { margin-bottom: 2rem; padding-left: 0.5rem; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--transition);
  text-decoration: none;
}
.nav-item:hover { background: var(--navy-light); color: var(--white); }
.nav-item--active { background: rgba(91,78,255,0.15); color: var(--indigo-glow); }
.nav-item--admin { color: var(--amber); }
.nav-item--logout { color: var(--danger); margin-top: 0.5rem; }

.sidebar-footer { border-top: 1px solid var(--border); padding-top: 1rem; }

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--white); }
.user-plan { font-size: 0.75rem; color: var(--muted); }

/* ── Main Content ────────────────────────────── */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 900px;
  overflow-y: auto;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.page-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
}
.page-subtitle { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }

/* ── Quota Card ──────────────────────────────── */
.quota-card {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.quota-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.quota-label { font-size: 0.85rem; color: var(--muted); }
.quota-value { font-size: 0.9rem; font-weight: 600; }
.quota-bar {
  height: 6px;
  background: var(--navy-light);
  border-radius: 99px;
  overflow: hidden;
}
.quota-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--indigo-glow));
  border-radius: 99px;
  transition: width 0.5s ease;
}
.quota-upgrade {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--amber);
}
.quota-upgrade:hover { color: var(--white); }

/* ── CTA Generate ────────────────────────────── */
.cta-generate {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, var(--indigo) 0%, #8B5CF6 100%);
  color: #fff;
  padding: 1.25rem 1.75rem;
  border-radius: var(--radius);
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 2rem;
  transition: all var(--transition);
  text-decoration: none;
}
.cta-generate:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(91,78,255,0.45);
}

/* ── Section ─────────────────────────────────── */
.section { margin-bottom: 2rem; }
.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--white);
}

/* ── Audio List ──────────────────────────────── */
.audio-list { display: flex; flex-direction: column; gap: 0.5rem; }
.audio-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  transition: border-color var(--transition);
}
.audio-item:hover { border-color: var(--indigo); }
.audio-icon {
  width: 36px;
  height: 36px;
  background: rgba(91,78,255,0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--indigo-glow);
  flex-shrink: 0;
}
.audio-meta { flex: 1; min-width: 0; }
.audio-title {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audio-detail { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }
.audio-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.audio-status--done       { background: rgba(34,197,94,0.15); color: var(--success); }
.audio-status--processing { background: rgba(245,166,35,0.15); color: var(--amber); }
.audio-status--pending    { background: rgba(136,144,176,0.15); color: var(--muted); }
.audio-status--error      { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ── Empty State ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  background: var(--navy-mid);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state p { margin-bottom: 1rem; }

/* ── Topbar Mobile (hambúrguer) ───────────────── */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--navy-mid);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 200;
}
.mobile-topbar .brand-logo {
  font-family: 'Syne', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
}
.mobile-topbar .brand-logo span { color: var(--indigo-glow); }

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.25s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Overlay escuro atrás do menu */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 299;
}
.sidebar-overlay.show { display: block; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  .mobile-topbar { display: flex; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 300;
    padding-top: 1.5rem;
  }
  .sidebar.open { transform: translateX(0); }

  .main-content {
    padding: 1.25rem 1rem;
    margin-top: 56px; /* espaço da topbar */
  }

  .auth-card {
    padding: 1.75rem 1.25rem;
  }

  /* Quota bar e cards no painel ficam em coluna */
  .page-header { flex-direction: column; gap: 0.75rem; }
}
