/**
 * Globale Formular- und Button-Klassen (Vanilla HTML / Digitool iframe).
 * Entspricht FormField + Button aus @digisky/ui.
 */

.ds-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.45rem;
}

.ds-field--inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ds-field--inline .ds-field__label {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.ds-field--inline .ds-field__control {
  flex: 0 0 auto;
  width: auto;
  min-width: 7rem;
}

.ds-field__label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.3;
}

.ds-field--on-dark .ds-field__label {
  color: #f8fafc;
}

.ds-field__control {
  width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.ds-field__control:focus {
  border-color: var(--ui-accent-primary);
  box-shadow: 0 0 0 2px var(--ui-accent-ring);
}

.ds-field__control:disabled {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

.ds-field--checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.ds-field--checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

.ds-field--checkbox .ds-field__label {
  font-weight: 500;
  font-size: 0.75rem;
  margin: 0;
}

.ds-field--on-dark.ds-field--checkbox .ds-field__label {
  color: #f8fafc;
}

/* Buttons — aligned with Button.module.css */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.3125rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s,
    opacity 0.15s;
  line-height: 1.3;
  font-family: inherit;
}

.ds-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.ds-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.ds-btn--sm {
  padding: 0.1875rem 0.5rem;
  font-size: 0.625rem;
}

.ds-btn--block {
  width: 100%;
}

.ds-btn--primary,
.ds-btn--secondary {
  border-color: var(--ui-accent-primary);
  background: #ffffff;
  color: var(--ui-accent-primary);
}

.ds-btn--primary:hover:not(:disabled),
.ds-btn--secondary:hover:not(:disabled) {
  background: var(--ui-accent-primary-soft);
  border-color: var(--ui-accent-primary-hover);
  color: var(--ui-accent-primary-hover);
}

.ds-btn--neutral {
  border-color: #d1d5db;
  background: #ffffff;
  color: #475569;
}

.ds-btn--neutral:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
}

.ds-btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ui-accent-primary);
}

.ds-btn--ghost:hover:not(:disabled) {
  background: var(--ui-accent-primary-soft);
}

.ds-btn-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.35rem;
}

.ds-btn-row .ds-btn {
  flex: 1 1 0;
}

.ds-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
