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

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --border: #1e1e2e;
  --text: #e0e0e8;
  --muted: #888;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --google-blue: #4285f4;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 16px;
}

#app { width: 100%; max-width: 640px; }

/* ── Steps ────────────────────────────────────────────────────────────── */
.step { display: none; }
.step.active { display: block; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

h1 { font-size: 1.5rem; text-align: center; margin-bottom: 4px; }
h2 { font-size: 1.1rem; margin-bottom: 12px; color: var(--muted); }
.subtitle { text-align: center; color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }

/* ── Forms ────────────────────────────────────────────────────────────── */
input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}
input:focus { border-color: var(--accent); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover { background: var(--border); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  width: 100%;
  margin-top: 8px;
}
.btn.primary:hover { background: var(--accent-hover); }

.btn.big { font-size: 1.1rem; padding: 14px 24px; margin-top: 16px; }

.btn.google {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  width: 100%;
}
.btn.google:hover { background: #f5f5f5; }

.btn.back {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.9rem;
}

.btn.small { padding: 6px 12px; font-size: 0.8rem; }

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* ── Status ───────────────────────────────────────────────────────────── */
.status {
  margin-top: 8px;
  font-size: 0.85rem;
  min-height: 1.2em;
}
.status.ok { color: var(--success); }
.status.error { color: var(--danger); }
.status.loading { color: var(--muted); }

.auth-section { margin-bottom: 24px; }
.auth-section:last-of-type { margin-bottom: 0; }

/* ── Albums ───────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.topbar h2 { margin: 0; flex: 1; text-align: center; }

.badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

.album-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.album-actions span { margin-left: auto; color: var(--muted); font-size: 0.85rem; }

.album-list {
  max-height: 50vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.album-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.album-item:last-child { border-bottom: none; }
.album-item:hover { background: rgba(99, 102, 241, 0.08); }
.album-item.selected { background: rgba(99, 102, 241, 0.12); }

.album-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  accent-color: var(--accent);
  cursor: pointer;
}

.album-name { flex: 1; font-weight: 500; }
.album-count { color: var(--muted); font-size: 0.85rem; margin-left: 8px; white-space: nowrap; }
.album-empty { color: var(--muted); font-style: italic; opacity: 0.5; }

/* ── Progress ─────────────────────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0 8px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
  width: 0%;
}

#progress-text { text-align: center; color: var(--muted); font-size: 0.9rem; }
.current-album { text-align: center; color: var(--accent); font-size: 0.85rem; margin-bottom: 16px; }

.transfer-log {
  max-height: 30vh;
  overflow-y: auto;
  font-size: 0.8rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}
.transfer-log .log-entry { padding: 2px 0; color: var(--muted); }
.transfer-log .log-entry.error { color: var(--danger); }
.transfer-log .log-entry.ok { color: var(--success); }

.transfer-actions { display: flex; gap: 8px; justify-content: center; }
.transfer-actions .btn { flex: 1; max-width: 200px; }

/* ── Utilities ────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  body { padding: 8px; }
  .card { padding: 16px; }
  h1 { font-size: 1.3rem; }
  .album-list { max-height: 40vh; }
}
