/* ─── Shared form layout (2-column with sticky sidebar) ─── */

.form-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}

.form-sidebar {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

/* ─── Form section headers ─── */

.form-section {
  margin-bottom: 1.75rem;
}
.form-section:last-of-type {
  margin-bottom: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 1.25rem;
}

.form-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.form-section-header svg {
  color: var(--gold-primary);
}
.form-section-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* ─── Sidebar cards ─── */

.sidebar-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.sidebar-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-base);
}
.sidebar-card-header h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.sidebar-card-body {
  padding: 1rem;
}
.sidebar-card-body .form-group { margin-bottom: 1rem; }
.sidebar-card-body .form-group:last-child { margin-bottom: 0; }
.sidebar-card-body .form-label { font-size: 0.75rem; margin-bottom: 0.375rem; }
.sidebar-card-body .form-hint { font-size: 0.6875rem; }

.sidebar-card-danger {
  border-color: rgba(248, 113, 113, 0.2);
}
.sidebar-card-danger .sidebar-card-header {
  background: rgba(248, 113, 113, 0.05);
}
.sidebar-card-danger .sidebar-card-header h4 {
  color: var(--error);
}

/* ─── Scope selector ─── */

.scope-option:has(input:checked) {
  border-color: var(--gold-primary);
  background: color-mix(in srgb, var(--gold-primary) 5%, transparent);
}
