/* ─────────────────────────────────────────────────────────────
   Divina Music — Placebo — Global Styles (dark mode only)
   ─────────────────────────────────────────────────────────────── */

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

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  line-height: 1.3;
  font-weight: 700;
}

p { color: var(--text-secondary); }
label { color: var(--text-secondary); }

a {
  color: var(--text-link);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}
a:hover { opacity: 0.8; }

button {
  font-family: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
}

/* ── Custom scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Selection ────────────────────────────────────────────── */
::selection {
  background: rgba(124, 58, 237, 0.28);
  color: var(--text-primary);
}

/* ── Focus ring ───────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════
   Component classes
   ═══════════════════════════════════════════════════════════ */

/* ── Layout container ─────────────────────────────────────── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.container-sm {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* ── Page wrapper ─────────────────────────────────────────── */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.card-elevated {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

/* ── Button ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1;
  border: none;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand-strong);
}
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-outline:hover {
  background: var(--bg-overlay);
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 8px var(--space-3);
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.btn-danger-ghost {
  background: transparent;
  color: var(--color-danger);
  border: 1px solid transparent;
  padding: 6px 10px;
}
.btn-danger-ghost:hover {
  border-color: var(--color-danger);
  background: var(--color-danger-subtle);
}
.btn-lg {
  padding: 14px var(--space-8);
  font-size: var(--font-size-md);
  border-radius: var(--radius-lg);
}
.btn-full { width: 100%; }

/* ── Input ────────────────────────────────────────────────── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.input-label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
}
.input-label .required { color: var(--color-danger); }
.input-field {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 10px var(--space-3);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  width: 100%;
  transition: border-color var(--transition-fast);
  -webkit-appearance: none;
}
.input-field::placeholder { color: var(--input-placeholder); }
.input-field:hover { border-color: var(--input-border-hover); }
.input-field:focus {
  outline: none;
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.input-field.error { border-color: var(--color-danger); }
.input-error {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
}
.input-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ── Select ───────────────────────────────────────────────── */
.input-field.select-field {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236e6a8a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  appearance: none;
}

/* ── Radio group ──────────────────────────────────────────── */
.radio-group {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.radio-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}
.radio-option input[type=radio] { accent-color: var(--brand-primary); }
.radio-option.selected { color: var(--text-primary); }

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border-default);
  margin: var(--space-6) 0;
}

/* ── Badge ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.badge-brand {
  background: var(--brand-glow);
  color: var(--brand-accent);
  border: 1px solid rgba(124,58,237,0.3);
}

/* ── Toast ────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideInRight 0.2s ease;
  max-width: 320px;
}
.toast-error { background: var(--color-danger); }
.toast-success { background: #22c55e; }
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Progress bar ─────────────────────────────────────────── */
.progress-bar-track {
  height: 3px;
  background: var(--border-default);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ── Upload dropzone ──────────────────────────────────────── */
.dropzone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
  cursor: pointer;
  background: var(--bg-elevated);
  transition: all var(--transition-base);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--brand-primary);
  background: var(--bg-overlay);
}
.dropzone.has-file { border-color: var(--color-success); }
.dropzone.error-state { border-color: var(--color-danger); }

/* ── Section header ───────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.section-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-glow);
  border: 1px solid rgba(124,58,237,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--brand-accent);
  flex-shrink: 0;
}

/* ── Artist row (comissão) ────────────────────────────────── */
.artist-row {
  display: flex;
  gap: var(--space-2);
  align-items: flex-end;
}
.artist-row .input-group { flex: 1; }

/* ── Checkbox ─────────────────────────────────────────────── */
.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  transition: all var(--transition-fast);
}
.checkbox-option:hover { border-color: var(--border-strong); }
.checkbox-option.checked { border-color: var(--brand-primary); background: var(--brand-glow); }
.checkbox-option input[type=checkbox] { accent-color: var(--brand-primary); margin-top: 2px; flex-shrink: 0; }
.checkbox-option .check-label { display: flex; flex-direction: column; gap: 2px; }
.checkbox-option .check-title { font-size: var(--font-size-base); font-weight: 600; color: var(--text-primary); }
.checkbox-option .check-desc { font-size: var(--font-size-sm); color: var(--text-muted); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}
.modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 440px;
  width: 100%;
  animation: scaleIn 0.15s ease;
}
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Step wizard ──────────────────────────────────────────── */
.wizard-header {
  padding: var(--space-6) 0 var(--space-8);
}
.wizard-step-label {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brand-accent);
  margin-bottom: var(--space-1);
}
.wizard-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.wizard-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .container, .container-sm { padding: 0 var(--space-3); }
  .card, .card-elevated { padding: var(--space-4); }
  .btn-lg { padding: 12px var(--space-6); }
  .grid-2 { grid-template-columns: 1fr !important; }
}

/* ═══════════════════════════════════════════════════════════
   Dashboard layout
   ═══════════════════════════════════════════════════════════ */

/* ── Root grid ────────────────────────────────────────────── */
.db-root {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.db-sidebar {
  grid-column: 1;
  grid-row: 1 / -1;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  transition: transform 0.25s ease;
}
.db-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--space-6) 0;
}
.db-logo {
  font-size: var(--font-size-lg);
  font-weight: 800;
  letter-spacing: -0.5px;
  padding: 0 var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--space-4);
}
.db-profile {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 0 var(--space-4) var(--space-5);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-default);
}
.db-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.db-profile-name {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  line-height: 1.3;
}
.db-profile-sub {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ── Nav ──────────────────────────────────────────────────── */
.db-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3) var(--space-2);
}
.db-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  width: 100%;
}
.db-nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.db-nav-item.active {
  background: var(--brand-glow);
  color: var(--brand-accent);
  font-weight: 600;
}
.db-logout {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast);
  margin-top: auto;
}
.db-logout:hover { color: var(--color-danger); }

/* ── Top bar (mobile only) ────────────────────────────────── */
.db-topbar {
  display: none;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: 40;
}
.db-menu-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  line-height: 0;
}
.db-menu-toggle:hover { color: var(--text-primary); }

/* ── Overlay (mobile) ─────────────────────────────────────── */
.db-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 45;
  backdrop-filter: blur(2px);
}
.db-overlay.visible { display: block; }

/* ── Main ─────────────────────────────────────────────────── */
.db-main {
  grid-column: 2;
  padding: var(--space-8);
  max-width: 780px;
  width: 100%;
}

/* ── Section header ───────────────────────────────────────── */
.db-section-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-default);
}
.db-section-title {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: var(--space-1);
}
.db-section-sub {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* ── Stat cards ───────────────────────────────────────────── */
.db-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.db-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}
.db-stat-card.db-stat-euros {
  border-color: rgba(124,58,237,0.3);
  background: linear-gradient(135deg, rgba(124,58,237,0.08) 0%, var(--bg-surface) 100%);
}
.db-stat-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.db-stat-value {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: var(--space-1);
}
.db-stat-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ── Generic card ─────────────────────────────────────────── */
.db-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
}
.db-euro-card {
  border-color: rgba(124,58,237,0.25);
  background: linear-gradient(135deg, rgba(124,58,237,0.06) 0%, var(--bg-surface) 100%);
}

/* ── Quick actions ────────────────────────────────────────── */
.db-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3);
}
.db-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  transition: all var(--transition-fast);
}
.db-quick-btn:hover {
  border-color: var(--brand-accent);
  color: var(--text-primary);
  background: var(--brand-glow);
}

/* ── 2-col grid ───────────────────────────────────────────── */
.db-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

/* ── Action card ──────────────────────────────────────────── */
.db-action-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--brand-glow);
  border: 1px solid rgba(124,58,237,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-accent);
  margin-bottom: var(--space-4);
}

/* ── Empresário option buttons ────────────────────────────── */
.db-emp-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: left;
  transition: all 0.15s;
  width: 100%;
}
.db-emp-btn:hover {
  border-color: var(--brand-accent);
  color: var(--text-primary);
}
.db-emp-btn.active {
  border-color: var(--brand-accent);
  background: rgba(124,58,237,0.08);
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Info rows ────────────────────────────────────────────── */
.db-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
  font-size: var(--font-size-sm);
  gap: var(--space-4);
}
.db-info-row:last-child { border-bottom: none; }
.db-info-label {
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

/* ── YouTube unificação — checklist ──────────────────────── */
.yt-req-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.yt-req-check:hover { border-color: var(--border-strong); }
.yt-req-check.checked {
  border-color: var(--color-success);
  background: var(--color-success-subtle);
}
.yt-req-check input[type=checkbox] { display: none; }
.yt-check-box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 4px;
  margin-top: 1px;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.yt-req-check.checked .yt-check-box {
  background: var(--color-success);
  border-color: var(--color-success);
}
.yt-req-check.checked .yt-check-box::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}
.yt-check-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.yt-check-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}
.yt-check-desc {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   Dashboard — Responsive (mobile)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .db-root {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  /* Sidebar vira drawer deslizante */
  .db-sidebar {
    grid-column: unset;
    grid-row: unset;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 260px;
    transform: translateX(-100%);
    z-index: 50;
    border-right: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
  }
  .db-sidebar.open {
    transform: translateX(0);
  }

  .db-topbar {
    display: flex;
  }

  .db-main {
    grid-column: 1;
    padding: var(--space-4) var(--space-4) var(--space-10);
    max-width: 100%;
  }

  .db-stats-grid {
    grid-template-columns: 1fr;
  }

  .db-quick-actions {
    grid-template-columns: 1fr 1fr;
  }

  .db-grid-2 {
    grid-template-columns: 1fr;
  }

  .db-section-title {
    font-size: var(--font-size-xl);
  }
}

@media (max-width: 400px) {
  .db-quick-actions {
    grid-template-columns: 1fr;
  }
}
