/* YAFC SSO - Minimalist High-End UI */
/* Design: Monochrome base, refined typography, generous spacing */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --text: #111111;
  --text-2: #555555;
  --text-3: #888888;
  --border: #e5e5e5;
  --border-2: #d4d4d4;
  --accent: #111111;
  --accent-text: #ffffff;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #161616;
    --surface-2: #1f1f1f;
    --text: #f5f5f5;
    --text-2: #a3a3a3;
    --text-3: #6b6b6b;
    --border: #2a2a2a;
    --border-2: #3a3a3a;
    --accent: #f5f5f5;
    --accent-text: #0a0a0a;
    --danger: #f87171;
    --danger-bg: #2a1212;
    --success: #4ade80;
    --success-bg: #0a2a12;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  }
}

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

html { font-size: 15px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-brand {
  padding: 28px 24px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.5px;
}
.brand-name { font-weight: 600; font-size: 16px; letter-spacing: -0.3px; }
.brand-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.nav { padding: 8px 12px; flex: 1; overflow-y: auto; }
.nav-section { margin-bottom: 24px; }
.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  padding: 8px 12px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 1px;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; margin-left: 240px; padding: 40px 48px; max-width: 100%; }
.page-header { margin-bottom: 32px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.page-subtitle { color: var(--text-3); font-size: 14px; margin-top: 4px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 24px; }
.card-body.no-pad { padding: 0; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .main { padding: 24px; } .sidebar { transform: translateX(-100%); } }

/* ---------- Stats ---------- */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.stat-value { font-size: 32px; font-weight: 700; letter-spacing: -1px; }
.stat-label { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  font-weight: 600;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-2); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.input, .textarea, .select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--text-3);
  box-shadow: 0 0 0 3px var(--surface-2);
}
.textarea { min-height: 80px; resize: vertical; }
.input.mono { font-family: var(--mono); font-size: 13px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover:not(:disabled) { opacity: 0.85; }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-2); }
.btn-danger { background: transparent; border-color: var(--border); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-bg); border-color: var(--danger); }
.btn-text { background: transparent; color: var(--text-2); }
.btn-text:hover:not(:disabled) { color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-neutral { background: var(--surface-2); color: var(--text-2); }

/* ---------- Auth Pages ---------- */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.auth-card.wide { max-width: 480px; }
.auth-brand { text-align: center; margin-bottom: 32px; }
.auth-brand .brand-mark { width: 48px; height: 48px; margin: 0 auto 16px; font-size: 22px; }
.auth-title { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; text-align: center; }
.auth-subtitle { font-size: 14px; color: var(--text-3); text-align: center; margin-top: 6px; margin-bottom: 28px; }
.auth-form .form-group:last-of-type { margin-bottom: 24px; }
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-3);
}
.auth-footer a { color: var(--text); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ---------- Alerts ---------- */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }

/* ---------- Authorize Page ---------- */
.authorize-card { max-width: 440px; }
.authorize-app {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}
.app-badge {
  width: 44px; height: 44px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.app-title { font-weight: 600; font-size: 15px; }
.app-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.authorize-text { font-size: 14px; color: var(--text-2); margin-bottom: 12px; }
.scope-list { list-style: none; margin-bottom: 24px; }
.scope-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
}
.scope-list .check {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--success-bg);
  position: relative;
  flex-shrink: 0;
}
.scope-list .check::after {
  content: '';
  position: absolute;
  left: 5px; top: 3px;
  width: 4px; height: 8px;
  border: solid var(--success);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.authorize-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}
.authorize-user .user-avatar { width: 28px; height: 28px; font-size: 12px; }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-3); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }

.code-block {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  word-break: break-all;
  position: relative;
}
.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-2);
}
.copy-btn:hover { background: var(--surface-2); color: var(--text); }

.mono { font-family: var(--mono); font-size: 13px; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 13px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  overflow-y: auto;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 48px);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 20px;
  padding: 4px;
  line-height: 1;
}
.modal-body { padding: 24px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* Landing */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  border-bottom: 1px solid var(--border);
}
.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  max-width: 720px;
  margin: 0 auto;
}
.landing-hero h1 {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 20px;
}
.landing-hero p {
  font-size: 18px;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 36px;
}
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.feature-card {
  text-align: center;
  padding: 32px 24px;
}
.feature-icon {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  color: var(--text-2);
}
.feature-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.feature-desc { font-size: 14px; color: var(--text-3); line-height: 1.6; }
@media (max-width: 768px) {
  .landing-features { grid-template-columns: 1fr; }
  .landing-hero h1 { font-size: 36px; }
  .landing-nav { padding: 16px 24px; }
}

/* Tag input */
.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 42px;
  align-items: center;
}
.tag-input input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 120px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  font-family: var(--mono);
}
.tag-remove {
  cursor: pointer;
  opacity: 0.5;
  font-size: 14px;
  line-height: 1;
}
.tag-remove:hover { opacity: 1; }

/* ---------- App Detail: Tabs ---------- */
.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.detail-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.detail-back:hover { background: var(--surface-2); color: var(--text); }
.detail-title-block { flex: 1; min-width: 0; }
.detail-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.detail-subtitle { color: var(--text-3); font-size: 13px; margin-top: 4px; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
  font-family: var(--font);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Toggle Switch ---------- */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border-2);
  border-radius: 22px;
  transition: 0.2s;
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: var(--surface);
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.switch-row:last-child { border-bottom: none; }
.switch-row-label { font-size: 14px; font-weight: 500; }
.switch-row-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.filter-bar .select {
  width: auto;
  min-width: 130px;
  padding: 8px 12px;
  font-size: 13px;
}
.filter-bar .search-input {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  padding: 8px 12px;
  font-size: 13px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-2);
  background: var(--surface);
  transition: all 0.15s;
}
.filter-chip:hover { background: var(--surface-2); }
.filter-chip.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* ---------- Detail info rows ---------- */
.info-row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-label {
  width: 160px;
  flex-shrink: 0;
  color: var(--text-3);
  font-size: 13px;
}
.info-value { flex: 1; word-break: break-all; }

/* ---------- Status badge variants ---------- */
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-info { background: #dbeafe; color: #2563eb; }
@media (prefers-color-scheme: dark) {
  .badge-warning { background: #3a2a0a; color: #fbbf24; }
  .badge-info { background: #0a1f3a; color: #60a5fa; }
}

/* ---------- Role mapping table ---------- */
.mapping-row {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 32px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.mapping-arrow { text-align: center; color: var(--text-3); }

/* ---------- Checkbox list ---------- */
.check-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}
.check-item:hover { background: var(--surface-2); }
.check-item input { margin: 0; }

/* ---------- Nav card (overview links) ---------- */
.nav-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.nav-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-2);
}
.nav-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface-2);
  margin: 0 auto 12px;
}
.nav-card-icon svg { width: 24px; height: 24px; color: var(--text); }
.nav-card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.nav-card-desc { font-size: 13px; color: var(--text-3); }

/* ---------- Code block with header ---------- */
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--mono);
}
.code-block-body {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}

/* ---------- Section divider ---------- */
.section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ---------- Captcha ---------- */
.captcha-wrap {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.captcha-img {
  width: 120px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .15s, border-color .15s;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.captcha-img:hover { border-color: var(--border-2); transform: translateY(-1px); }
.captcha-img img { display: block; width: 100%; height: 100%; -webkit-user-drag: none; pointer-events: none; }
.captcha-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  text-align: center;
  letter-spacing: 4px;
  font-family: var(--mono);
  font-size: 18px;
  text-transform: uppercase;
}

/* ---------- Responsive detail ---------- */
@media (max-width: 768px) {
  .mapping-row { grid-template-columns: 1fr 1fr; }
  .mapping-arrow { display: none; }
  .info-row { flex-direction: column; gap: 4px; }
  .info-label { width: auto; }
}
