/* Dokumentumtípus választó + modálok (v6.03.31) */

.documents-type-field {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.documents-type-field__label {
  display: block;
  margin: 0;
}

.documents-type-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.documents-type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  max-width: 100%;
  word-break: break-word;
  text-align: center;
  border: 1.5px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.documents-type-chip:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.documents-type-chip:active {
  transform: scale(0.98);
}

.documents-type-chip.is-active {
  border-color: #2563eb;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.documents-type-chip.is-active:hover {
  border-color: #1d4ed8;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.documents-type-chip__check {
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0.95;
}

.documents-type-chip--add {
  background: #f8fafc;
  color: #2563eb;
  border: 1.5px dashed #93c5fd;
  box-shadow: none;
}

.documents-type-chip--add:hover {
  background: #eff6ff;
  border-color: #60a5fa;
}

html.dark .documents-type-chip {
  background: #1f2937;
  border-color: #4b5563;
  color: #e5e7eb;
}

html.dark .documents-type-chip:hover {
  background: #374151;
  border-color: #6b7280;
}

html.dark .documents-type-chip.is-active {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
}

html.dark .documents-type-chip--add {
  background: rgba(30, 41, 59, 0.65);
  color: #93c5fd;
  border-color: #475569;
}

html.dark .documents-type-chip--add:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: #60a5fa;
}

/* Kiválasztott típus műveletsor */
.documents-type-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.documents-type-actions.hidden {
  display: none;
}

.documents-type-actions__label {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #4b5563;
}

.documents-type-actions__label strong {
  color: #111827;
  font-weight: 700;
}

.documents-type-actions__hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #6b7280;
}

.documents-type-actions__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.documents-type-actions__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.documents-type-actions__btn--secondary {
  background: #ffffff;
  border-color: #d1d5db;
  color: #374151;
}

.documents-type-actions__btn--secondary:hover {
  background: #f3f4f6;
}

.documents-type-actions__btn--danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.documents-type-actions__btn--danger:hover {
  background: #fee2e2;
}

html.dark .documents-type-actions {
  background: rgba(31, 41, 55, 0.6);
  border-color: #374151;
}

html.dark .documents-type-actions__label {
  color: #d1d5db;
}

html.dark .documents-type-actions__label strong {
  color: #f9fafb;
}

html.dark .documents-type-actions__hint {
  color: #9ca3af;
}

html.dark .documents-type-actions__btn--secondary {
  background: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

html.dark .documents-type-actions__btn--danger {
  background: rgba(127, 29, 29, 0.35);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

/* Modálok */
.documents-type-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.documents-type-modal-overlay.is-open {
  display: flex;
}

body.documents-type-modal-open {
  overflow: hidden;
}

.documents-type-modal-card {
  width: min(100%, 420px);
  max-width: 94vw;
  margin: 0 auto;
  padding: 1.375rem 1.25rem 1.25rem;
  border-radius: 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18), 0 8px 16px rgba(15, 23, 42, 0.08);
  box-sizing: border-box;
}

html.dark .documents-type-modal-card {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.documents-type-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
  text-align: left;
}

html.dark .documents-type-modal__title {
  color: #f9fafb;
}

.documents-type-modal__hint {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #6b7280;
  text-align: left;
}

html.dark .documents-type-modal__hint {
  color: #9ca3af;
}

.documents-type-modal__label {
  display: block;
  margin: 0 0 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
}

html.dark .documents-type-modal__label {
  color: #d1d5db;
}

.documents-type-modal__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 2.75rem;
  padding: 0.625rem 0.875rem;
  margin: 0 0 1.25rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.75rem;
  font-size: 1rem;
  line-height: 1.35;
  color: #111827;
  background: #f9fafb;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.documents-type-modal__input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: #fff;
}

html.dark .documents-type-modal__input {
  color: #f3f4f6;
  background: #111827;
  border-color: #4b5563;
}

html.dark .documents-type-modal__input:focus {
  border-color: #60a5fa;
  background: #0f172a;
}

.documents-type-modal__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.625rem;
}

.documents-type-modal__actions-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.625rem;
}

.documents-type-modal__btn {
  flex: 1 1 0;
  min-height: 2.75rem;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.documents-type-modal__btn--secondary {
  background: #f3f4f6;
  color: #374151;
}

.documents-type-modal__btn--secondary:hover {
  background: #e5e7eb;
}

.documents-type-modal__btn--primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.documents-type-modal__btn--primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.documents-type-modal__btn--danger-solid {
  background: #fef2f2;
  color: #dc2626;
  border: 1.5px solid #fecaca;
}

.documents-type-modal__btn--danger-solid:hover {
  background: #fee2e2;
}

html.dark .documents-type-modal__btn--secondary {
  background: #374151;
  color: #e5e7eb;
}

html.dark .documents-type-modal__btn--danger-solid {
  background: rgba(127, 29, 29, 0.4);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}

@media (max-width: 380px) {
  .documents-type-modal-card {
    padding: 1.125rem 1rem 1rem;
  }

  .documents-type-actions__buttons {
    flex-direction: column;
  }

  .documents-type-actions__btn {
    width: 100%;
  }

  .documents-type-modal__actions-row {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }

  .documents-type-modal__actions-row .documents-type-modal__btn {
    width: 100%;
    flex: none;
  }
}

@media (min-width: 640px) {
  .documents-type-modal-card {
    padding: 1.5rem;
  }

  .documents-type-modal__actions-row .documents-type-modal__btn {
    flex: 0 0 auto;
    min-width: 6.5rem;
  }
}
