/* ═══════════════════════════════════════════════════════════
   REELFLOW — COMPONENTS
   ═══════════════════════════════════════════════════════════ */

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  background: var(--accent-2);
  box-shadow: 0 6px 28px rgba(124,109,250,0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border-hover);
}
.btn-outline:hover { background: var(--surface); border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { color: var(--text-1); background: var(--surface); }

.btn-ig {
  background: linear-gradient(135deg, var(--ig-1), var(--ig-3), var(--ig-5));
  color: white;
  width: 100%;
  justify-content: center;
}
.btn-ig:hover { opacity: 0.9; transform: translateY(-1px); }

.auth-user-badge {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Cards ───────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-hover); }

.card-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── Stat cards ──────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-1);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}

/* ── Dashboard cards ─────────────────────────── */
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dash-card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}

/* ── Quick actions ───────────────────────────── */
.quick-actions { margin-top: 8px; }
.quick-actions h3 { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 16px; }

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.quick-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}
.quick-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.quick-icon { font-size: 22px; }

/* ── Forms ───────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}
.form-group:last-child { margin-bottom: 0; }

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-1);
  font-size: 14px;
  transition: all var(--transition);
  width: 100%;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input[readonly] { color: var(--text-2); cursor: default; }

.form-hint {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
.form-hint a {
  color: var(--info);
  text-decoration: none;
}
.form-hint a:hover { text-decoration: underline; }

.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.char-count {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

.input-with-copy {
  display: flex;
  gap: 8px;
}

.btn-copy {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition);
}
.btn-copy:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* Radio */
.radio-group, .schedule-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-2);
  transition: color var(--transition);
}
.radio-item:hover { color: var(--text-1); }
.radio-item input[type="radio"] { display: none; }

.radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-hover);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--transition);
  position: relative;
}

.radio-item input[type="radio"]:checked + .radio-custom {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.radio-item input[type="radio"]:checked + .radio-custom::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: white;
  border-radius: 50%;
}

.schedule-datetime { margin-top: 12px; }

.select-sm {
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-1);
  border-color: var(--border);
  background: var(--surface);
  cursor: pointer;
}

/* ── Upload zone ─────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-3);
}
.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.01);
}

.upload-icon { font-size: 36px; color: var(--text-muted); margin-bottom: 16px; }

.upload-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-2);
  font-size: 14px;
}
.upload-text strong { color: var(--text-1); font-size: 16px; }
.upload-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.upload-zone-editor { padding: 32px; }

/* ── Editor overhaul ─────────────────────────── */
.editor-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.editor-toolbar,
.editor-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.editor-toolbar {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(124,109,250,0.12), rgba(255,255,255,0.02));
}

.editor-toolbar-copy,
.editor-history-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-1);
}

.editor-toolbar-actions,
.editor-history-stats,
.editor-copy-tabs,
.editor-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.editor-upload-panel,
.editor-history-panel,
.editor-project-card,
.editor-summary-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.editor-upload-panel,
.editor-history-panel {
  padding: 20px;
}

.editor-upload-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.editor-video-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.editor-project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.editor-project-card.selected {
  border-color: rgba(124,109,250,0.55);
  box-shadow: 0 0 0 1px rgba(124,109,250,0.22), 0 10px 30px rgba(0,0,0,0.22);
}

.editor-project-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.editor-project-thumb {
  width: 72px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.editor-project-thumb video,
.editor-copy-preview video,
.editor-config-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.editor-project-info {
  min-width: 0;
  flex: 1;
}

.editor-project-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-project-meta {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}

.editor-project-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.editor-project-actions .btn-primary {
  flex: 1;
  justify-content: center;
}

.editor-mini-actions {
  display: flex;
  gap: 8px;
}

.editor-history-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 18px;
}

.editor-summary-box {
  padding: 14px 16px;
}

.editor-summary-box strong {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-1);
  line-height: 1;
}

.editor-summary-box span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.editor-history-table-wrapper {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.editor-history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  font-size: 14px;
}

.editor-history-table th,
.editor-history-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.editor-history-table th {
  background: var(--bg-3);
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.editor-history-table tbody tr:hover {
  background: var(--bg-3);
}

.editor-history-table .empty-row td {
  padding: 0;
}

.editor-state-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.editor-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 140px;
}

.editor-progress .progress-bar {
  height: 6px;
}

.editor-progress-label {
  font-size: 12px;
  color: var(--text-muted);
}

.editor-history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.editor-modal {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 20px;
}

.editor-modal-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.editor-config-preview {
  width: 100%;
  aspect-ratio: 9 / 16;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}

.editor-modal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  word-break: break-word;
}

.editor-config-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.editor-copy-tabs {
  padding: 4px;
  border-radius: var(--radius);
  background: var(--bg-3);
  border: 1px solid var(--border);
  max-height: 176px;
  overflow: auto;
}

.editor-copy-tab {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
}

.editor-copy-tab.active {
  background: var(--surface);
  color: var(--text-1);
  border-color: var(--accent);
}

.editor-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.editor-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-3);
  border: 1px solid var(--border);
}

.editor-control-group label,
.editor-control-row label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
}

.editor-control-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor-control-row .range-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.editor-switch-row {
  display: flex;
  gap: 10px;
}

.editor-switch-row .btn {
  flex: 1;
  justify-content: center;
}

.editor-font-swatch,
.editor-bg-swatch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.editor-swatch-btn {
  border: 1px solid var(--border);
  background: var(--bg-3);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  transition: all var(--transition);
  color: var(--text-1);
}

.editor-swatch-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124,109,250,0.15);
}

.editor-swatch-btn small {
  display: block;
  color: var(--text-2);
  margin-top: 4px;
}

.editor-title-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  border-radius: 12px;
  margin-top: 4px;
  max-width: 100%;
}

.editor-title-preview.hidden-bg {
  background: transparent !important;
  box-shadow: none !important;
}

.editor-title-preview span {
  max-width: 100%;
  word-break: break-word;
}

.editor-preview-stage {
  isolation: isolate;
}

.editor-preview-title-overlay {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100% - 24px);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
  cursor: grab;
  user-select: none;
  touch-action: none;
  transform: translate(-50%, -50%);
  text-align: center;
  backdrop-filter: blur(8px);
}

.editor-preview-title-overlay span {
  pointer-events: none;
  display: block;
  max-width: 100%;
  word-break: break-word;
}

.editor-preview-title-overlay.is-empty {
  opacity: 0;
  pointer-events: none;
}

.editor-preview-title-overlay:active {
  cursor: grabbing;
}

.editor-scroll-note {
  font-size: 12px;
  color: var(--text-muted);
}

.editor-job-status {
  font-size: 12px;
  color: var(--text-2);
}

.editor-job-status strong {
  color: var(--text-1);
}

.editor-job-error {
  margin-top: 6px;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.35;
}

.editor-job-detail {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.editor-job-progress {
  width: 100%;
}

.editor-job-progress .progress-bar {
  margin-top: 8px;
}

.editor-history-panel .btn-sm {
  white-space: nowrap;
}

/* Video preview */
.video-preview-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.video-preview {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  max-height: 320px;
}
.video-info { font-size: 12px; color: var(--text-2); }

/* ── Platform cards ──────────────────────────── */
.connect-platforms { display: flex; flex-direction: column; gap: 20px; }

.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}
.platform-card:hover { border-color: var(--border-hover); }
.platform-card.connected { border-color: rgba(34,201,122,0.3); }

.platform-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.platform-logo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.platform-info { flex: 1; }
.platform-info h3 { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.platform-info p { font-size: 12px; color: var(--text-2); }

.platform-body { padding: 24px; }

.credentials-form { display: flex; flex-direction: column; gap: 0; }

.connected-accounts { display: flex; flex-direction: column; gap: 12px; }

.account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.account-item-info { flex: 1; }
.account-item-name { font-size: 14px; font-weight: 600; }
.account-item-meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.account-item-remove {
  background: none;
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px;
  transition: color var(--transition);
}
.account-item-remove:hover { color: var(--danger); }

/* ── Account selector (publisher) ────────────── */
.account-selector { display: flex; flex-direction: column; gap: 10px; }
.account-select-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.account-select-item:hover { border-color: var(--accent); }
.account-select-item.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}
.account-select-item .check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-hover);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  font-size: 11px;
  transition: all var(--transition);
}
.account-select-item.selected .check {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ── Publish status ──────────────────────────── */
.publish-status { font-size: 13px; text-align: center; min-height: 20px; }
.publish-status.success { color: var(--success); }
.publish-status.error { color: var(--danger); }
.publish-status.loading { color: var(--text-2); }

/* ── History table ───────────────────────────── */
.history-table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.history-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.history-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.history-table tr:last-child td { border-bottom: none; }
.history-table tbody tr:hover { background: var(--bg-3); }
.history-table .empty-row td { padding: 0; }

/* ── Tokens list ─────────────────────────────── */
.tokens-list { display: flex; flex-direction: column; gap: 10px; }
.token-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.token-platform { font-weight: 600; }
.token-expiry { font-size: 11px; color: var(--text-2); }

/* ── Sys info ────────────────────────────────── */
.sys-info { display: flex; flex-direction: column; gap: 12px; }
.sys-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-2);
}

/* ── Toast ───────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.success::before { content: '✓'; color: var(--success); font-weight: 700; }
.toast.error::before   { content: '✕'; color: var(--danger); font-weight: 700; }

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

/* ── Modal ───────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  padding: 0;
  width: 90%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
.modal.modal-editor-wide {
  max-width: 1220px;
}
.modal.modal-editor-wide .modal-body {
  max-height: calc(100vh - 120px);
  overflow: auto;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  color: var(--text-muted);
  font-size: 18px;
  padding: 4px 8px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-1); }
.modal-body { padding: 24px; }

.auth-screen {
  min-height: 100vh;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(124,109,250,0.22), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(230,104,60,0.16), transparent 28%),
    linear-gradient(180deg, #09090d 0%, #0d0d14 100%);
}

.auth-backdrop {
  position: absolute;
  border-radius: 999px;
  filter: blur(14px);
  pointer-events: none;
}

.auth-backdrop-one {
  width: 320px;
  height: 320px;
  left: -90px;
  top: 12%;
  background: rgba(124, 109, 250, 0.28);
}

.auth-backdrop-two {
  width: 260px;
  height: 260px;
  right: -70px;
  bottom: 8%;
  background: rgba(220, 39, 67, 0.16);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}

.auth-copy,
.auth-panel {
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(12, 12, 18, 0.84);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0,0,0,0.45);
}

.auth-copy {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--ig-3));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  box-shadow: var(--shadow-accent);
}

.auth-eyebrow {
  color: var(--ig-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-copy h1 {
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  max-width: 10ch;
}

.auth-description {
  max-width: 56ch;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.7;
}

.auth-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.auth-point {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.5;
}

.auth-panel {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.auth-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-panel-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-panel-status {
  color: var(--text-2);
  font-size: 13px;
}

.auth-loading {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-2);
  text-align: center;
}

.auth-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: var(--accent);
  animation: authSpin 0.8s linear infinite;
}

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

.auth-form { display: none; }

.auth-screen[data-state="ready"] .auth-loading {
  display: none;
}

.auth-screen[data-state="ready"] .auth-form {
  display: block;
}

.auth-note {
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

.auth-error {
  min-height: 20px;
  margin-bottom: 14px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 960px) {
  .editor-modal {
    grid-template-columns: 1fr;
  }

  .editor-config-grid {
    grid-template-columns: 1fr;
  }

  .editor-project-actions {
    flex-direction: column;
    align-items: stretch;
  }

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

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-points {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .auth-screen {
    padding: 16px;
  }

  .auth-copy,
  .auth-panel {
    padding: 22px;
    border-radius: 22px;
  }

  .auth-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-copy h1 {
    max-width: none;
  }
}
