/* ===================
   MODAL - ESTILOS GLOBAIS
   =================== */

/* Dialog base */
dialog {
  background: white;
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 90%;
  width: 600px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

/* Container interno com scroll */
.modal-content {
  padding: 2rem;
  overflow-y: auto;
  max-height: 90vh;
}

/* Botão fechar */
.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  color: #6b7280;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-close-btn:hover {
  background: #e5e7eb;
  color: #1f2937;
}

/* Header do modal */
.modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-right: 2rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.modal-subtitle {
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.5;
}

/* Botão WhatsApp */
.modal-whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: #22c55e;
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-whatsapp-btn:hover {
  background: #16a34a;
  color: white;
}

.modal-whatsapp-btn i {
  font-size: 1.25rem;
}

/* Separador "ou" */
.modal-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.modal-divider-line {
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.modal-divider-text {
  font-size: 0.85rem;
  color: #9ca3af;
  font-weight: 500;
}

/* ===================
   FORMULÁRIO - ESTILOS
   =================== */

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Grupo de campo */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Label */
.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

/* Hint/descrição */
.form-hint {
  font-size: 0.8rem;
  color: #9ca3af;
  line-height: 1.5;
  margin-top: -0.25rem;
}

/* Input, Select, Textarea */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: #1f2937;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  background: white;
  border-color: #C8A253;
  box-shadow: 0 0 0 3px rgba(200, 162, 83, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #9ca3af;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Grid 2 colunas */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Seção condicional */
.form-conditional {
  padding: 1rem;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #C8A253;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-conditional.hidden {
  display: none;
}

/* Checkboxes */
.form-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-checkbox:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #C8A253;
  cursor: pointer;
}

.form-checkbox span {
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.3;
}

.form-checkbox:has(input:checked) {
  background: #fffbf5;
  border-color: #C8A253;
}

/* Input de arquivo */
.form-file {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.9rem;
  color: #6b7280;
  background: #fafafa;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-file:hover {
  border-color: #C8A253;
  background: #fffbf5;
}

.form-file::file-selector-button {
  padding: 0.5rem 1rem;
  margin-right: 1rem;
  background: #1f2937;
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.form-file::file-selector-button:hover {
  background: #374151;
}

/* Botão de envio */
.form-submit {
  width: 100%;
  padding: 0.9rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  background: #1f2937;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 0.5rem;
}

.form-submit:hover {
  background: #C8A253;
  color: #1a1a1a;
}

/* ===================
   RESPONSIVO
   =================== */

@media (max-width: 640px) {
  dialog {
    max-width: 95%;
    border-radius: 12px;
  }

  .modal-content {
    padding: 1.5rem;
  }

  .modal-title {
    font-size: 1.25rem;
  }

  .modal-subtitle {
    font-size: 0.9rem;
  }

  .form-input,
  .form-select,
  .form-textarea {
    padding: 0.7rem 0.875rem;
    font-size: 0.9rem;
  }
}
