/* Dash-Host — Form Styles */

.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.form-label.required::after {
  content: ' *';
  color: #dc2626;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
  line-height: 1.5;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}
.form-control:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.form-control.is-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}
.form-control.is-valid {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5,150,105,.1);
}

textarea.form-control { resize: vertical; min-height: 80px; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.2rem;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.form-error {
  font-size: 0.78rem;
  color: #dc2626;
  margin-top: 0.25rem;
  display: none;
}
.form-error.visible { display: block; }

/* ── Input groups ─────────────────────────────────────────── */
.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .form-control {
  flex: 1;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.input-group-append {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: var(--bg);
  border: 1px solid var(--input-border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ── Inline checkbox/radio ────────────────────────────────── */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 1rem; height: 1rem;
  accent-color: var(--primary);
  cursor: pointer;
}
.form-check-label { font-size: 0.875rem; cursor: pointer; }

/* ── Form grid ────────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.form-row-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.filter-bar .form-control { max-width: 200px; }
.filter-bar input[type="search"] { max-width: 260px; }

/* ── Password strength ────────────────────────────────────── */
.password-strength {
  margin-top: 0.4rem;
  display: flex;
  gap: 4px;
}
.password-strength-bar {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--border);
  transition: background 0.3s;
}
.strength-weak    .password-strength-bar:nth-child(1) { background: #ef4444; }
.strength-fair    .password-strength-bar:nth-child(-n+2) { background: #f97316; }
.strength-good    .password-strength-bar:nth-child(-n+3) { background: #eab308; }
.strength-strong  .password-strength-bar { background: #22c55e; }

/* ── Code / script textarea ───────────────────────────────── */
.code-textarea {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  resize: vertical;
  min-height: 200px;
  line-height: 1.6;
  tab-size: 2;
}
