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

:root {
  --bg: #f3f4f6;
  --bg-card: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-success: #f0fdf4;
  --bg-info: #fef2f2;
  --text-primary: #1e2226;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --text-success: #15803d;
  --text-info: #791414;
  --text-danger: #c62121;
  --border: #e5e7eb;
  --border-em: #d1d5db;
  --border-success: #bbf7d0;
  --border-info: #fecaca;
  --border-success: #bbf7d0;
  --border-info: #fecaca;
  --brand: #c62121;
  --brand-hover: #a81b1b;
  --brand-dark: #791414;
  --green: #16a34a;
  --green-dark: #15803d;
  --topbar: #1e2226;
  --radius: 8px;
  --radius-lg: 20px;
  --shadow: 0 8px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
}


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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ── Topbar ── */
.topbar {
  background: #1e2226;
  padding: 0 32px;
  height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.topbar-logo { display: flex; align-items: center; gap: 0; }
.topbar-title {
  color: #9ca3af;
  font-size: 14px; font-weight: 400; letter-spacing: 0.03em;
  padding-left: 16px; margin-left: 16px;
  border-left: 1px solid #374151;
}
.badge-secure {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
  background: rgba(22,163,74,0.15);
  color: #4ade80;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px; padding: 5px 14px;
}

/* ── Navbar ── */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  box-shadow: var(--shadow-sm);
}
.nav-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 15px 20px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  color: var(--text-muted);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; transition: color 0.15s;
}
.nav-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.nav-tab:hover:not(.active) { color: var(--text-primary); }

/* ── Main ── */
.main { flex: 1; padding: 40px 48px 60px; max-width: 1400px; margin: 0 auto; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Alert bar ── */
.alert-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--brand);
  border-left: 4px solid var(--brand-dark);
  border-radius: var(--radius);
  padding: 11px 16px;
  margin-bottom: 32px;
  font-size: 13px; color: #fff;
}

/* ── Page heading ── */
.page-heading { text-align: center; margin-bottom: 36px; }
.page-heading h1 { font-size: 26px; font-weight: 700; color: var(--text-primary); }
.page-heading p { font-size: 14px; color: var(--text-secondary); margin-top: 6px; }

/* ── Flow row ── */
.flow-row {
  display: flex; align-items: stretch; gap: 0;
  width: 100%; margin-bottom: 24px;
}

/* ── Flow cards ── */
.flow-card {
  flex: 1; background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.flow-card-top { height: 5px; width: 100%; }
.card-source .flow-card-top { background: var(--green); }
.card-dest .flow-card-top { background: var(--brand); }

.flow-card-body { padding: 28px 28px 24px; flex: 1; }

.flow-card-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.flow-icon-src { background: #f0fdf4; }
.flow-icon-dst { background: #fef2f2; }

.flow-card-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 4px 10px; border-radius: 6px; margin-bottom: 10px;
}
.tag-src { background: #dcfce7; color: #15803d; }
.tag-dst { background: #fef2f2; color: #c62121; }

.flow-card-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.flow-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }

/* ── Form fields (card-field) ── */
.card-field { margin-bottom: 14px; }
.card-field:last-child { margin-bottom: 0; }
.card-field label {
  display: block; font-size: 11px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 5px;
}
.card-field input[type="text"],
.card-field input[type="password"],
input[type="text"],
input[type="password"] {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13.5px; font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:hover, input[type="password"]:hover { border-color: var(--border-em); }
input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(198,33,33,0.10); }
input.field-hint { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
input.field-hint:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(198,33,33,0.10); }

.field-row { display: flex; gap: 8px; }
.pass-wrap { position: relative; }
input[type="password"] { padding-right: 40px; }
.eye-btn {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); display: flex; align-items: center; padding: 0;
  transition: color 0.15s;
}
.eye-btn:hover { color: var(--text-primary); }

/* ── Port selector ── */
.port-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.port-opt {
  display: block;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; font-family: inherit;
  background: var(--bg-card);
  user-select: none; transition: all 0.15s;
}
.port-opt:hover { border-color: var(--brand); }
.port-opt:hover .port-opt-inner { color: var(--brand-dark); }
.port-opt.active { background: var(--bg-info); border-color: var(--brand); }
.port-opt.active .port-opt-inner { color: var(--brand-dark); font-weight: 500; }
.port-opt-inner {
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  padding: 14px 16px;
  font-size: 13px; color: var(--text-secondary); line-height: 1;
}
.radio-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-em);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: border-color 0.15s;
}
.radio-dot.active { border-color: var(--brand); }
.radio-dot.active::after {
  content: ''; width: 8px; height: 8px;
  border-radius: 50%; background: var(--brand); display: block;
}

/* ── Locked destination block ── */
.locked-block {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.locked-block-label {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 2px;
}
.locked-block-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.locked-badge-green {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  color: var(--green-dark); background: var(--bg-success);
  border: 1px solid var(--border-success);
  padding: 3px 9px; border-radius: 6px; flex-shrink: 0;
}

/* ── Test button ── */
.btn-test {
  height: 40px; padding: 0 16px; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer; flex-shrink: 0; transition: all 0.15s;
}
.btn-test:hover { border-color: var(--brand); color: var(--brand); }

.test-result {
  margin-top: 8px; padding: 8px 12px;
  border-radius: var(--radius); font-size: 12px; font-weight: 500;
}
.test-result.ok { background: var(--bg-success); color: var(--text-success); border: 1px solid var(--border-success); }
.test-result.fail { background: var(--bg-info); color: var(--brand); border: 1px solid var(--border-info); }

/* ── Arrow ── */
.flow-arrow {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 0 16px; flex-shrink: 0;
}
.arrow-svg-wrap { animation: pulse-arrow 1.6s ease-in-out infinite; }
@keyframes pulse-arrow {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(6px); opacity: 0.7; }
}
.arrow-label {
  margin-top: 12px; font-size: 10px; font-weight: 700;
  color: var(--brand); letter-spacing: 0.08em;
  text-transform: uppercase; text-align: center; line-height: 1.4;
}

/* ── Status chips ── */
.status-row { display: flex; gap: 10px; margin-bottom: 20px; }
.status-chip {
  flex: 1; background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 14px; padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm);
  min-height: 70px;
}
.status-chip-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.dot-idle { background: var(--border-em); }
.dot-ok   { background: var(--green); box-shadow: 0 0 0 4px rgba(29,158,117,0.2); }
.dot-fail { background: var(--brand); box-shadow: 0 0 0 4px rgba(198,33,33,0.2); }
.dot-warn { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,0.2); animation: pulse 1.8s infinite; }
.dot-active { background: var(--brand); animation: pulse 1.4s infinite; }
.status-chip-info { flex: 1; min-width: 0; }
.status-chip-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.status-chip-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Steg-guide ── */
.step-item {
  display: flex; gap: 14px; margin-bottom: 20px;
  transition: opacity 0.2s;
}
.step-rail {
  display: flex; flex-direction: column; align-items: center;
  padding-top: 2px; flex-shrink: 0;
}
.step-bubble {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  transition: all 0.2s;
  background: var(--border-em); color: var(--text-muted);
}
.step-rail-line {
  width: 2px; flex: 1; background: var(--border);
  margin-top: 6px; min-height: 16px;
}
.step-body { flex: 1; min-width: 0; }
.step-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  margin-bottom: 8px;
}

/* Active step */
.step-item.step-active .step-bubble {
  background: var(--brand); color: #fff;
  box-shadow: 0 0 0 4px rgba(198,33,33,0.15);
  animation: step-pulse 2s infinite;
}
.step-item.step-active .step-label { color: var(--brand-dark); }
.step-item.step-active .step-rail-line { background: var(--brand); opacity: 0.3; }

/* Done step */
.step-item.step-done .step-bubble {
  background: var(--green); color: #fff;
  box-shadow: none; animation: none;
}
.step-item.step-done .step-label { color: var(--green); }
.step-item.step-done .step-body { opacity: 0.6; }
.step-item.step-done .step-rail-line { background: var(--green); }

/* Pending step */
.step-item.step-pending { opacity: 0.45; pointer-events: none; }
.step-item.step-pending .step-bubble { background: var(--border-em); }

@keyframes step-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(198,33,33,0.15); }
  50%       { box-shadow: 0 0 0 7px rgba(198,33,33,0.08); }
}

/* Auto-test status-rad */
.test-status-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted); margin-top: 8px;
}

/* Manuell-test-knapp */
.btn-test-manual {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px;
  font-size: 12px; color: var(--text-muted);
  cursor: pointer; font-family: inherit; margin-top: 10px;
  transition: all 0.15s;
}
.btn-test-manual:hover { border-color: var(--brand); color: var(--brand-dark); }

/* ── MX-lookup status ── */
.mx-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 5px 10px; border-radius: 20px;
  margin-bottom: 8px; width: fit-content;
}
.mx-lookup { background: #eff6ff; color: #1d4ed8; }
.mx-ok     { background: #f0fdf4; color: #166534; }
.mx-none   { background: #fafafa; color: var(--text-muted); }

/* ── Provider pills ── */
.provider-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.provider-pill {
  padding: 5px 12px; font-size: 12px; font-weight: 500; font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card); color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.provider-pill:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--bg-info); transform: translateY(-1px); }
.provider-pill.active {
  background: var(--brand); border-color: var(--brand);
  color: white; font-weight: 600;
  box-shadow: 0 2px 8px rgba(198,33,33,0.3);
}
.provider-note {
  margin-top: 8px; padding: 8px 12px;
  border-radius: var(--radius); font-size: 12px; line-height: 1.5;
}
.provider-note.info { background: var(--bg-info); color: var(--brand-dark); border: 1px solid var(--border-info); }
.provider-note.warn { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.9s linear infinite; transform-origin: center; }

/* ── MX-detected badge ── */
.mx-detected-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 500; margin-bottom: 14px;
}
.mx-badge-ok      { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.mx-badge-loading { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.mx-badge-info    { background: #fefce8; color: #854d0e; border: 1px solid #fde68a; }
.mx-badge-warn    { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }

/* ── Server-section (manuell) ── */
#server-section {
  border: 1.5px dashed var(--border-em);
  border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.server-section-header {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-muted); margin-bottom: 14px;
  font-weight: 500;
}

/* ── "Fel server?"-länk ── */
.btn-manual-override {
  background: none; border: none; padding: 0;
  font-size: 12px; color: var(--text-muted); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  margin-bottom: 12px; display: block;
}
.btn-manual-override:hover { color: var(--brand); }

/* ── Buttons ── */
.btn-fetch {
  width: 100%; height: 48px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-em);
  border-radius: 12px;
  color: var(--text-primary); font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.15s; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.btn-fetch:disabled { opacity: 0.38; cursor: not-allowed; box-shadow: none; }
.btn-fetch-ready {
  background: var(--green); border-color: var(--green);
  color: #fff; box-shadow: 0 2px 10px rgba(29,158,117,0.3);
}
.btn-fetch-ready:hover { background: #178a66; border-color: #178a66; color: #fff; }

/* ── "Ange manuellt"-rad ── */
.mx-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 22px; }
.btn-manual-trigger {
  background: none; border: none; padding: 0;
  font-size: 12px; color: var(--text-muted); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  font-family: inherit;
}
.btn-manual-trigger:hover { color: var(--brand); }

/* ── Info-ikon i serveradressfält ── */
.input-icon-wrap { position: relative; flex: 1; }
.input-icon-wrap input { width: 100%; }
.field-info-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  color: #3b82f6; padding: 0; transition: background 0.15s;
}
.field-info-btn:hover { background: rgba(59,130,246,0.12); }
.input-icon-wrap input { padding-right: 36px; }

@keyframes note-flash {
  0%,100% { box-shadow: none; }
  40% { box-shadow: 0 0 0 4px rgba(245,158,11,0.4); }
}
.note-flash { animation: note-flash 0.6s ease; }

.btn-start {
  width: 100%; height: 54px;
  background: var(--brand); border: none;
  border-radius: 12px;
  color: white; font-size: 16px; font-weight: 700; font-family: inherit;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: all 0.2s;
  box-shadow: 0 6px 24px rgba(198,33,33,0.35);
}
.btn-start:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn-start:hover:not(:disabled) { background: var(--brand-hover); box-shadow: 0 8px 32px rgba(198,33,33,0.45); transform: translateY(-2px); }
.btn-start:active:not(:disabled) { transform: translateY(0); }

.disclaimer {
  text-align: center; font-size: 12px;
  color: var(--text-muted); margin-top: 12px;
}

/* ── Folder picker ── */
#folder-picker {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.picker-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.picker-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text-primary);
}
.check-all-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer; user-select: none;
}
.check-all-label input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); }
.folder-checklist { max-height: 280px; overflow-y: auto; }
.folder-check-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.1s;
}
.folder-check-row:last-child { border-bottom: none; }
.folder-check-row:hover { background: var(--bg-secondary); }
.folder-check-row input[type=checkbox] { width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; accent-color: var(--brand); }
.folder-check-row label { flex: 1; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.folder-check-count { font-size: 12px; color: var(--text-muted); }
.picker-footer {
  padding: 10px 18px; font-size: 12px; font-weight: 500;
  color: var(--text-secondary); background: var(--bg-secondary);
  border-top: 1px solid var(--border); text-align: right;
}

/* ── Status tab ── */
.section-title {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px;
}
.status-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.status-idle {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 3rem 2rem; color: var(--text-muted); text-align: center;
}
.progress-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.progress-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.pct-text { font-size: 13px; font-weight: 600; color: var(--brand); }
.progress-sub { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.pbar-bg { height: 8px; background: var(--bg-secondary); border-radius: 8px; overflow: hidden; margin-bottom: 1.25rem; }
.pbar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), #e84040); border-radius: 8px; transition: width 0.5s ease; }
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.stat { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat-n { font-size: 24px; font-weight: 700; }
.stat-n.green { color: var(--green-dark); }
.stat-n.red { color: var(--brand); }
.stat-l { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }

.folders-card { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-card); }
.folder-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.folder-row:last-child { border-bottom: none; }
.folder-name { flex: 1; color: var(--text-primary); font-weight: 500; }
.folder-bar-bg { width: 100px; height: 5px; background: var(--bg-secondary); border-radius: 3px; overflow: hidden; }
.folder-bar-fill { height: 100%; background: var(--brand); border-radius: 3px; }
.folder-count { font-size: 12px; color: var(--text-muted); width: 70px; text-align: right; }
.folder-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.folder-badge.done { background: var(--bg-success); color: var(--text-success); }
.folder-badge.active { background: var(--bg-info); color: var(--brand-dark); }
.folder-badge.wait { background: var(--bg-secondary); color: var(--text-muted); }
.folder-badge.error { background: var(--bg-info); color: var(--brand); }

.log-wrap { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; max-height: 220px; overflow-y: auto; }
.log-line { font-family: monospace; font-size: 12px; line-height: 1.9; color: var(--text-secondary); }
.log-line.ok { color: var(--green-dark); }
.log-line.err { color: var(--brand); }
.log-line.info { color: var(--text-info); }

/* ── Google OAuth ── */
.btn-google-auth {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 42px; padding: 0 16px;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary); font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: all 0.15s;
}
.btn-google-auth:hover { background: var(--bg-secondary); border-color: var(--border-em); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.btn-google-auth:disabled { opacity: 0.5; cursor: not-allowed; }
.oauth-connected-box {
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px;
  background: var(--bg-success); border: 1px solid var(--border-success);
  border-radius: var(--radius); font-size: 13px; color: var(--text-success);
}
.oauth-connected-box span { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-oauth-revoke {
  font-size: 11px; font-weight: 500; padding: 4px 10px;
  background: none; border: 1px solid var(--border-success);
  border-radius: 20px; color: var(--text-success);
  cursor: pointer; white-space: nowrap; flex-shrink: 0; font-family: inherit;
}
.btn-oauth-revoke:hover { background: rgba(0,0,0,0.04); }

/* ── Responsive ── */
/* ── Footer ── */
.site-footer {
  background: #1e2226;
  color: #9ca3af;
  padding: 48px 48px 36px;
  margin-top: 40px;
  font-size: 13px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 64px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: space-between;
}
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-divider {
  width: 100%;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin: 28px 0 20px;
}
.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-copy { color: #4b5563; font-size: 12px; }
.footer-powered { color: #4b5563; font-size: 12px; }
.footer-powered a { color: #6b7280; text-decoration: none; }
.footer-powered a:hover { color: #fff; }
.footer-contact h4 {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: #6b7280; margin-bottom: 6px;
}
.footer-contact-row { display: flex; align-items: center; gap: 8px; color: #9ca3af; line-height: 1.6; }

/* ── Cookie-banner ── */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #1e2226;
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 1000;
  padding: 14px 32px;
}
.cookie-banner-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #9ca3af;
  font-size: 13px;
  line-height: 1.5;
}
.cookie-banner-inner p { flex: 1; }
.btn-cookie-ok {
  flex-shrink: 0;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  align-self: center;
}
.btn-cookie-ok:hover { background: var(--red-dark, #b91c1c); }

/* ── FAQ ── */
.faq-wrap { max-width: 760px; margin: 0 auto; }
.faq-section-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--red);
  margin: 32px 0 12px;
}
.faq-section-title:first-child { margin-top: 0; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 18px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text-primary);
  text-align: left;
}
.faq-q:hover { color: var(--red); }
.faq-chevron { flex-shrink: 0; transition: transform 0.25s ease; color: var(--text-muted); }
.faq-item.open .faq-chevron { transform: rotate(180deg); color: var(--red); }
.faq-item.open > .faq-q { color: var(--red); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 18px;
  font-size: 13px; color: var(--text-secondary); line-height: 1.7;
  border-top: 0px solid var(--border);
}
.faq-item.open .faq-a {
  max-height: 600px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
}
.faq-a p { margin-bottom: 8px; }
.faq-a p:last-child { margin-bottom: 0; }
.faq-a ul { padding-left: 18px; margin: 6px 0 8px; }
.faq-a ul li { margin-bottom: 4px; }
.faq-a a { color: var(--red); text-decoration: none; }
.faq-a a:hover { text-decoration: underline; }
.faq-contact-box {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  margin-top: 32px; color: var(--text-secondary); font-size: 13px;
}
.faq-contact-box strong { display: block; color: var(--text-primary); margin-bottom: 4px; font-size: 14px; }
.faq-contact-box svg { flex-shrink: 0; margin-top: 2px; color: var(--red); }

@media (max-width: 700px) {
  .flow-row { flex-direction: column; }
  .flow-arrow { flex-direction: row; padding: 12px 0; }
  .arrow-svg-wrap { transform: rotate(90deg); }
  .status-row { flex-wrap: wrap; }
  .status-chip { flex: 1 1 calc(50% - 5px); }
  .main { padding: 24px 16px 40px; }
  .topbar { padding: 0 16px; }
  .navbar { padding: 0 16px; }
  .site-footer { padding: 24px 16px; }
  .cookie-banner { padding: 14px 16px; }
  .cookie-banner-inner { flex-direction: column; }
}
