/* === Neumorphism Design System === */
:root {
  --bg: #e0e5ec;
  --bg-dark: #d1d9e6;
  --text-primary: #2d3436;
  --text-secondary: #636e72;
  --text-muted: #b2bec3;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-dark: #5541d7;
  --danger: #d63031;
  --success: #00b894;
  --chord-color: #e17055;
  --shadow-light: rgba(255, 255, 255, 0.8);
  --shadow-dark: rgba(163, 177, 198, 0.6);
  --shadow-inset-light: rgba(255, 255, 255, 0.5);
  --shadow-inset-dark: rgba(163, 177, 198, 0.5);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
}

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

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
}

/* === App Layout === */
.app {
  max-width: 920px;
  margin: 0 auto;
  padding: 30px 20px;
}

/* === Header === */
.app-header {
  text-align: center;
  margin-bottom: 28px;
}

.logo-card {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 32px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
  margin-bottom: 12px;
}

.logo-icon {
  font-size: 32px;
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.15));
}

.logo-card h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 10px;
  font-weight: 400;
}

/* === Tab Navigation === */
.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
}

.tabs-nav-admin {
  margin-top: -20px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent);
  box-shadow:
    inset 3px 3px 6px var(--shadow-inset-dark),
    inset -3px -3px 6px var(--shadow-inset-light);
}

/* === Panels === */
.panel {
  display: none;
}

.panel.active {
  display: block;
}

/* === Search Card === */
.input-section {
  margin-bottom: 28px;
}

.search-card {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
}

.input-wrapper {
  flex: 1;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow:
    inset 3px 3px 6px var(--shadow-inset-dark),
    inset -3px -3px 6px var(--shadow-inset-light);
  padding: 2px;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.btn-icon {
  font-size: 16px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow:
    4px 4px 10px var(--shadow-dark),
    -4px -4px 10px var(--shadow-light),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow:
    2px 2px 6px var(--shadow-dark),
    -2px -2px 6px var(--shadow-light);
}

.btn-primary:active {
  box-shadow:
    inset 2px 2px 5px rgba(0,0,0,0.2),
    inset -2px -2px 5px rgba(255,255,255,0.1);
}

.btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  box-shadow:
    2px 2px 6px var(--shadow-dark),
    -2px -2px 6px var(--shadow-light);
}

.btn-action {
  background: var(--bg);
  color: var(--text-primary);
  box-shadow:
    4px 4px 10px var(--shadow-dark),
    -4px -4px 10px var(--shadow-light);
}

.btn-action:hover {
  box-shadow:
    2px 2px 5px var(--shadow-dark),
    -2px -2px 5px var(--shadow-light);
}

.btn-action:active {
  box-shadow:
    inset 3px 3px 6px var(--shadow-inset-dark),
    inset -3px -3px 6px var(--shadow-inset-light);
}

.btn-action:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow:
    4px 4px 10px var(--shadow-dark),
    -4px -4px 10px var(--shadow-light);
}

.btn-success:hover {
  filter: brightness(0.9);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow:
    4px 4px 10px var(--shadow-dark),
    -4px -4px 10px var(--shadow-light);
}

.btn-danger:hover {
  filter: brightness(0.9);
}

/* === Error Card === */
.error-card {
  margin-top: 16px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
  box-shadow:
    inset 3px 3px 6px var(--shadow-inset-dark),
    inset -3px -3px 6px var(--shadow-inset-light);
  border-left: 4px solid var(--danger);
}

/* === Loading Card === */
.loading-card {
  text-align: center;
  padding: 40px 20px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.spinner-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow:
    4px 4px 8px var(--shadow-dark),
    -4px -4px 8px var(--shadow-light);
  position: relative;
  animation: spin 1s linear infinite;
}

.spinner::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent-light);
}

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

/* === Progress Bar === */
.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 0 40px;
}

.progress-bar {
  flex: 1;
  height: 10px;
  border-radius: 10px;
  background: var(--bg);
  box-shadow:
    inset 2px 2px 4px var(--shadow-inset-dark),
    inset -2px -2px 4px var(--shadow-inset-light);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  min-width: 40px;
}

/* === Result Section (Tablatures) === */
.result-header-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
  margin-bottom: 20px;
}

.tab-info h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.artist {
  font-size: 16px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 4px;
}

.meta-info {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-info span {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--bg);
  box-shadow:
    inset 2px 2px 4px var(--shadow-inset-dark),
    inset -2px -2px 4px var(--shadow-inset-light);
  font-size: 12px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* === Tab Content Card === */
.tab-content-card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
  overflow-x: auto;
}

.tab-block {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre;
  margin: 10px 0;
  padding: 16px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  box-shadow:
    inset 3px 3px 6px var(--shadow-inset-dark),
    inset -3px -3px 6px var(--shadow-inset-light);
  overflow-x: auto;
}

.text-block {
  white-space: pre-wrap;
  margin: 12px 0;
  line-height: 1.7;
  padding: 8px 16px;
  color: var(--text-secondary);
}

.chord {
  color: var(--chord-color);
  font-weight: 700;
}

/* === Media Result Card === */
.media-result-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
}

.media-thumb {
  width: 120px;
  height: 90px;
  border-radius: var(--radius-xs);
  background: var(--bg-dark);
  box-shadow:
    inset 3px 3px 6px var(--shadow-inset-dark),
    inset -3px -3px 6px var(--shadow-inset-light);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-details {
  flex: 1;
  min-width: 0;
}

.media-details h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-uploader {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}

.media-duration {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.media-actions {
  flex-shrink: 0;
}

/* === Quality Select === */
.quality-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.select-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.quality-select-wrapper {
  flex: 1;
}

.quality-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg);
  border: none;
  border-radius: var(--radius-xs);
  box-shadow:
    inset 3px 3px 6px var(--shadow-inset-dark),
    inset -3px -3px 6px var(--shadow-inset-light);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23636e72' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.quality-select:focus {
  box-shadow:
    inset 3px 3px 6px var(--shadow-inset-dark),
    inset -3px -3px 6px var(--shadow-inset-light),
    0 0 0 2px var(--accent-light);
}

/* === Download Status === */
.download-status {
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow:
    inset 3px 3px 6px var(--shadow-inset-dark),
    inset -3px -3px 6px var(--shadow-inset-light);
  text-align: center;
}

.download-status.success {
  border-left: 4px solid var(--success);
  color: var(--success);
}

.download-status.error {
  border-left: 4px solid var(--danger);
  color: var(--danger);
}

.download-status a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.download-status a:hover {
  text-decoration: underline;
}

/* === Playlist === */
.playlist-header-card {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
  margin-bottom: 20px;
}

.playlist-info {
  margin-bottom: 16px;
}

.playlist-info h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.playlist-count {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 4px;
}

.playlist-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.playlist-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.playlist-items-card {
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
  overflow: hidden;
  max-height: 500px;
  overflow-y: auto;
}

.playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--bg-dark);
  transition: background 0.15s;
}

.playlist-item:last-child {
  border-bottom: none;
}

.playlist-item:hover {
  background: var(--bg-dark);
}

.playlist-item.downloading {
  opacity: 0.7;
}

.playlist-item.done {
  opacity: 1;
}

.playlist-item.skipped {
  opacity: 0.5;
  text-decoration: line-through;
  color: var(--text-muted);
}

.playlist-item-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--bg);
  box-shadow:
    inset 2px 2px 4px var(--shadow-inset-dark),
    inset -2px -2px 4px var(--shadow-inset-light);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}

.playlist-item-checkbox:checked {
  background: var(--accent);
  box-shadow:
    2px 2px 4px var(--shadow-dark),
    -2px -2px 4px var(--shadow-light);
}

.playlist-item-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.playlist-item-number {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 24px;
  text-align: right;
}

.playlist-item-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-item-duration {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.playlist-item-status {
  font-size: 13px;
  flex-shrink: 0;
  min-width: 24px;
  text-align: center;
}

.playlist-progress-card {
  margin-top: 16px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
}

.playlist-progress-card .progress-bar {
  height: 12px;
  margin-bottom: 10px;
}

.progress-label {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

/* === Playlist Download Results === */
.playlist-download-results {
  margin-top: 16px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
}

.download-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.download-results-header h4 {
  font-size: 16px;
  color: var(--text-primary);
}

.playlist-files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.playlist-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  box-shadow:
    inset 2px 2px 5px var(--shadow-inset-dark),
    inset -2px -2px 5px var(--shadow-inset-light);
}

.playlist-file-info {
  flex: 1;
  min-width: 0;
}

.playlist-file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-file-size {
  font-size: 12px;
  color: var(--text-secondary);
}

.playlist-file-download {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-xs);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-left: 12px;
  box-shadow:
    3px 3px 6px var(--shadow-dark),
    -3px -3px 6px var(--shadow-light);
  transition: filter 0.2s;
}

.playlist-file-download:hover {
  filter: brightness(0.9);
}

/* === Conversion Upload Zone === */
.convert-upload-card {
  flex-direction: column;
  align-items: center;
  padding: 0;
}

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 24px;
  width: 100%;
  border: 2px dashed var(--text-muted);
  border-radius: var(--radius);
  transition: border-color 0.3s, background 0.3s;
  cursor: pointer;
  text-align: center;
}

.upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.05);
}

.upload-icon {
  font-size: 48px;
  line-height: 1;
}

.upload-zone p {
  color: var(--text-secondary);
  font-size: 14px;
}

.upload-hint {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  margin-top: 4px;
}

.upload-btn {
  cursor: pointer;
}

.convert-file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

/* === Header Top Bar === */
.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 8px;
}

.header-user {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  box-shadow:
    inset 2px 2px 4px var(--shadow-inset-dark),
    inset -2px -2px 4px var(--shadow-inset-light);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
}

.btn-sm .btn-icon {
  font-size: 14px;
}

/* === Auth Page === */
.auth-page {
  max-width: 480px;
}

.auth-card {
  padding: 32px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow:
    inset 3px 3px 6px var(--shadow-inset-dark),
    inset -3px -3px 6px var(--shadow-inset-light);
}

.auth-tab {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-tab.active {
  background: var(--bg);
  color: var(--accent);
  box-shadow:
    4px 4px 8px var(--shadow-dark),
    -4px -4px 8px var(--shadow-light);
}

.auth-field {
  margin-bottom: 20px;
}

.auth-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.auth-form .input-wrapper {
  margin-bottom: 0;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.auth-footer-links {
  text-align: center;
  margin-top: 20px;
}

.auth-footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.auth-footer-links a:hover {
  text-decoration: underline;
}

/* === Verify Page === */
.verify-info {
  text-align: center;
  margin-bottom: 28px;
}

.verify-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.verify-info p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 4px;
}

.verify-email {
  font-weight: 700;
  color: var(--accent) !important;
  font-size: 16px !important;
  margin-bottom: 8px !important;
}

.verify-hint {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  font-style: italic;
}

.verify-code-input {
  text-align: center;
  font-size: 24px !important;
  letter-spacing: 8px;
  font-weight: 700;
}

.verify-actions {
  text-align: center;
  margin-top: 16px;
}

.resend-btn {
  width: 100%;
  justify-content: center;
}

.success-card {
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-xs);
  background: rgba(0, 184, 148, 0.1);
  color: var(--success);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* === Accueil Page === */
.accueil-page {
  max-width: 960px;
}

.accueil-hero {
  margin-bottom: 40px;
}

.hero-card {
  padding: 40px 32px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
  text-align: center;
}

.hero-card h2 {
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.hero-card p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto 24px;
}

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

.hero-actions .btn {
  text-decoration: none;
}

.section-title {
  text-align: center;
  font-size: 22px;
  color: var(--text-primary);
  margin-bottom: 24px;
}

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

.feature-card {
  padding: 28px 24px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    6px 6px 12px var(--shadow-dark),
    -6px -6px 12px var(--shadow-light);
  text-align: center;
  transition: transform 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.feature-card h4 {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* === Legal Pages === */
.legal-page {
  max-width: 800px;
}

.legal-card {
  padding: 40px 32px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
  margin-bottom: 32px;
}

.legal-card h2 {
  font-size: 24px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.legal-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.legal-card h3 {
  font-size: 17px;
  color: var(--accent);
  margin-top: 28px;
  margin-bottom: 12px;
}

.legal-card h4 {
  font-size: 15px;
  color: var(--text-primary);
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.legal-card ul {
  margin: 8px 0 16px 24px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.legal-card a {
  color: var(--accent);
  text-decoration: none;
}

.legal-card a:hover {
  text-decoration: underline;
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}

.cookie-table th,
.cookie-table td {
  padding: 12px 16px;
  text-align: left;
  border-radius: var(--radius-xs);
}

.cookie-table th {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow:
    inset 2px 2px 4px var(--shadow-inset-dark),
    inset -2px -2px 4px var(--shadow-inset-light);
}

.cookie-table td {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--bg-dark);
}

.cookie-table code {
  background: var(--bg-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* === Footer Links === */
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  transition: color 0.2s;
}

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

/* === Scraping === */
.scraping-form-card {
  flex-direction: column;
  gap: 12px;
}

.scraping-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.scraping-options {
  display: flex;
  gap: 12px;
}

.scraping-history-card {
  margin-top: 16px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
}

.scraping-history-card h4 {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.scraping-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  box-shadow:
    inset 2px 2px 5px var(--shadow-inset-dark),
    inset -2px -2px 5px var(--shadow-inset-light);
}

.history-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.history-keywords {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.history-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.scraping-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.scraping-results-header h4 {
  font-size: 15px;
  color: var(--text-primary);
}

.scraping-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);
}

.scraping-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.scraping-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-dark);
  position: sticky;
  top: 0;
}

.scraping-table td {
  padding: 10px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--bg-dark);
}

.scraping-table tr.verified td {
  color: var(--text-primary);
}

.scraping-table tr.unverified td {
  opacity: 0.6;
}

.email-cell {
  font-weight: 500;
  color: var(--accent) !important;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
}

.mx-cell {
  text-align: center;
  width: 50px;
}

.source-cell a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
}

.source-cell a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* === Prospecting Quotas === */
.prospecting-quotas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg);
  box-shadow: 2px 2px 5px var(--shadow-dark), -2px -2px 5px var(--shadow-light);
}

.quota-badge.configured {
  color: var(--success);
}

.quota-badge.not-configured {
  color: var(--text-muted);
  opacity: 0.6;
}

.quota-badge .quota-count {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-secondary);
}

.prospecting-errors {
  margin: 8px 0;
}

.prospecting-error-item {
  font-size: 12px;
  color: var(--danger);
  margin: 2px 0;
}

/* === Pagination === */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 0 8px;
  flex-wrap: wrap;
}

.pagination-controls button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow:
    3px 3px 6px var(--shadow-dark),
    -3px -3px 6px var(--shadow-light);
  transition: all 0.15s ease;
}

.pagination-controls button:hover {
  color: var(--text-primary);
  box-shadow:
    2px 2px 4px var(--shadow-dark),
    -2px -2px 4px var(--shadow-light);
}

.pagination-controls button.active {
  background: var(--accent);
  color: #fff;
  box-shadow:
    inset 2px 2px 4px rgba(0,0,0,0.15),
    inset -1px -1px 3px rgba(255,255,255,0.1);
}

.pagination-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-controls .pagination-info {
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 8px;
}

/* === Global Task Banner === */
.global-task-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  padding: 10px 20px;
  box-shadow: 0 2px 12px rgba(108, 92, 231, 0.4);
}

body.has-global-task {
  padding-top: 52px;
}

.global-task-content {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
}

.global-task-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

#globalTaskText {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-task-progress {
  width: 120px;
  height: 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.25);
  overflow: hidden;
  flex-shrink: 0;
}

.global-task-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: #fff;
  transition: width 0.3s ease;
}

.global-task-percent {
  font-size: 12px;
  font-weight: 700;
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.global-task-cancel {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
  line-height: 1;
}

.global-task-cancel:hover {
  background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 640px) {
  .global-task-banner {
    padding: 8px 12px;
  }

  .global-task-content {
    font-size: 12px;
    gap: 8px;
  }

  .global-task-progress {
    width: 60px;
  }
}

/* === Footer === */
.app-footer {
  text-align: center;
  margin-top: 40px;
  padding: 16px;
  color: var(--text-muted);
  font-size: 12px;
}

/* === Responsive — Tablet === */
@media (max-width: 768px) {
  .tabs-nav {
    gap: 6px;
    padding: 6px;
  }

  .tab-btn {
    padding: 10px 10px;
    font-size: 13px;
  }

  .tabs-nav-admin {
    margin-top: -20px;
  }

  .quality-row {
    flex-direction: column;
    gap: 8px;
  }

  .scraping-options {
    flex-direction: column;
  }

  .playlist-actions-row {
    flex-wrap: wrap;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .history-actions {
    align-self: flex-end;
  }

  .scraping-results-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .download-results-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}

/* === Responsive — Mobile === */
@media (max-width: 640px) {
  .app {
    padding: 16px 10px;
  }

  /* Header */
  .header-top {
    flex-direction: column;
    gap: 12px;
  }

  .header-user {
    position: static;
    justify-content: center;
  }

  .user-badge {
    display: none;
  }

  .logo-card {
    padding: 12px 20px;
    gap: 10px;
  }

  .logo-icon {
    font-size: 26px;
  }

  .logo-card h1 {
    font-size: 20px;
  }

  .subtitle {
    font-size: 13px;
  }

  /* Tabs */
  .tabs-nav {
    gap: 4px;
    padding: 6px;
  }

  .tab-btn {
    flex: 1 1 calc(33% - 4px);
    padding: 10px 8px;
    font-size: 12px;
  }

  .tabs-nav-admin {
    margin-top: -16px;
  }

  /* Search cards */
  .search-card {
    flex-direction: column;
    padding: 14px;
  }

  .input-wrapper input {
    padding: 12px 14px;
    font-size: 14px;
  }

  .btn {
    padding: 12px 18px;
    font-size: 13px;
    justify-content: center;
    width: 100%;
  }

  .btn-sm {
    width: auto;
    padding: 8px 14px;
  }

  /* Result header */
  .result-header-card {
    flex-direction: column;
    padding: 16px;
    gap: 12px;
  }

  .tab-info h2 {
    font-size: 18px;
  }

  .artist {
    font-size: 14px;
  }

  .actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .actions .btn-action,
  .actions .btn {
    flex: 1;
    min-width: 0;
  }

  /* Tab content */
  .tab-content-card {
    padding: 12px;
  }

  .tab-block {
    font-size: 10px;
    padding: 10px;
    line-height: 1.3;
  }

  /* Media card */
  .media-result-card {
    flex-direction: column;
    text-align: center;
    padding: 16px;
    gap: 12px;
  }

  .media-details h3 {
    white-space: normal;
    font-size: 16px;
  }

  .media-thumb {
    width: 140px;
    height: 100px;
  }

  .media-actions {
    width: 100%;
  }

  .media-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Quality selects */
  .quality-row {
    flex-direction: column;
    gap: 8px;
  }

  .quality-select {
    font-size: 14px;
    padding: 12px 14px;
  }

  /* Playlist */
  .playlist-header-card {
    padding: 16px;
  }

  .playlist-info h3 {
    font-size: 17px;
  }

  .playlist-actions-row {
    flex-direction: column;
    gap: 8px;
  }

  .playlist-actions-row .btn {
    width: 100%;
  }

  .playlist-item {
    padding: 10px 12px;
    gap: 8px;
  }

  .playlist-item-title {
    font-size: 13px;
  }

  .playlist-item-number {
    min-width: 18px;
    font-size: 11px;
  }

  .playlist-file-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .playlist-file-download {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }

  /* Conversion */
  .upload-zone {
    padding: 24px 16px;
  }

  .upload-icon {
    font-size: 36px;
  }

  .convert-file-icon {
    width: 60px;
    height: 60px;
    font-size: 36px;
  }

  /* Scraping / Entreprises */
  .scraping-form-card {
    padding: 14px;
  }

  .scraping-options {
    flex-direction: column;
  }

  .scraping-table-wrapper {
    margin: 0 -14px;
    border-radius: 0;
  }

  .scraping-table th,
  .scraping-table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  .scraping-results-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .history-actions {
    align-self: flex-end;
  }

  /* Progress */
  .progress-bar-container {
    padding: 0 8px;
    flex-direction: column;
    gap: 6px;
  }

  .loading-card {
    padding: 24px 16px;
  }

  /* Accueil */
  .hero-card {
    padding: 24px 16px;
  }

  .hero-card h2 {
    font-size: 22px;
  }

  .hero-card p {
    font-size: 14px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .feature-card {
    padding: 20px 16px;
  }

  .section-title {
    font-size: 18px;
  }

  /* Legal */
  .legal-card {
    padding: 24px 16px;
  }

  .cookie-table th,
  .cookie-table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Auth */
  .auth-card {
    padding: 24px 16px;
  }

  .auth-tabs {
    gap: 4px;
  }

  .auth-tab {
    font-size: 13px;
    padding: 10px;
  }

  /* Admin */
  .admin-feature-row {
    flex-direction: column !important;
  }

  .admin-feat-icon {
    width: 100% !important;
  }

  /* Footer */
  .footer-links {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .app-footer {
    margin-top: 24px;
  }
}

/* === Print Styles === */
@media print {
  .no-print {
    display: none !important;
  }

  :root {
    --bg: #fff;
    --shadow-light: transparent;
    --shadow-dark: transparent;
    --shadow-inset-light: transparent;
    --shadow-inset-dark: transparent;
  }

  body {
    background: #fff;
    font-size: 10pt;
  }

  .app {
    max-width: 100%;
    padding: 0;
  }

  .result-header-card,
  .tab-content-card,
  .tab-block {
    box-shadow: none;
    padding: 0;
    border-radius: 0;
  }

  .result-header-card {
    border-bottom: 1px solid #333;
    margin-bottom: 10pt;
    padding-bottom: 6pt;
  }

  .tab-block {
    font-size: 9pt;
    line-height: 1.3;
    page-break-inside: avoid;
    margin: 4px 0;
    padding: 4px 0;
  }

  .tab-info h2 {
    font-size: 16pt;
  }

  .artist {
    font-size: 12pt;
    color: #333;
  }

  .meta-info span {
    box-shadow: none;
    padding: 0;
    margin-right: 8px;
  }

  .app-footer,
  .tabs-nav {
    display: none;
  }
}
