/**
 * Sistema de Contratos - CSS Customizado
 * Bonfim Gourmet
 * 
 * @version 2.0.0
 * @date 07/02/2026
 */

/* ========================================
   Reset e Base
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f9fafb;
}

/* ========================================
   Variáveis CSS
   ======================================== */

:root {
  --primary: #d9232a;
  --secondary: #1f2937;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --light: #f9fafb;
  --white: #ffffff;
}

/* ========================================
   Formulário
   ======================================== */

input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 35, 42, 0.1);
  border-color: var(--primary);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

/* Estilo para inputs com erro */
input.border-red-500,
select.border-red-500,
textarea.border-red-500 {
  border-color: var(--danger) !important;
  background-color: #fef2f2;
}

/* Estilo para inputs válidos */
input.border-green-500,
select.border-green-500,
textarea.border-green-500 {
  border-color: var(--success) !important;
  background-color: #f0fdf4;
}

/* ========================================
   Preview do Contrato - Estilo Profissional
   ======================================== */

.contrato-preview {
  font-family: "Times New Roman", Times, serif;
  line-height: 1.8;
  color: #1a1a1a;
  background: #fff;
  padding: 3rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-size: 14px;
}

.contrato-preview h1 {
  font-size: 18px !important;
  font-weight: bold !important;
  text-align: center !important;
  margin-bottom: 2rem !important;
  color: #1f2937 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block !important;
}

.contrato-preview h2 {
  font-size: 14px !important;
  font-weight: bold !important;
  margin-top: 2rem !important;
  margin-bottom: 1rem !important;
  color: #1f2937 !important;
  text-transform: uppercase;
  display: block !important;
  letter-spacing: 0.3px;
}

.contrato-preview p {
  text-align: justify;
  text-justify: inter-word;
  margin-bottom: 1rem !important;
  display: block !important;
  color: #1a1a1a !important;
  line-height: 1.8;
}

.contrato-preview strong {
  font-weight: bold !important;
  color: #1f2937 !important;
}

.contrato-preview em {
  font-style: italic !important;
}

.contrato-preview u {
  text-decoration: underline !important;
}

.contrato-preview ol {
  margin-left: 2rem !important;
  margin-bottom: 1rem !important;
  list-style-type: decimal !important;
  display: block !important;
}

.contrato-preview ul {
  margin-left: 2rem !important;
  margin-bottom: 1rem !important;
  list-style-type: disc !important;
  display: block !important;
}

.contrato-preview li {
  margin-bottom: 0.5rem !important;
  display: list-item !important;
  line-height: 1.8;
  text-align: justify;
}

.contrato-preview .space-y-4 > div {
  margin-bottom: 1.5rem !important;
  display: block !important;
}

.contrato-preview .space-y-8 > * + * {
  margin-top: 2rem !important;
}

.contrato-preview .mb-4 {
  margin-bottom: 1rem !important;
}

.contrato-preview .mt-8 {
  margin-top: 2rem !important;
}

.contrato-preview .mt-12 {
  margin-top: 3rem !important;
}

.contrato-preview .text-right {
  text-align: right !important;
}

.contrato-preview .text-center {
  text-align: center !important;
}

.contrato-preview .whitespace-pre-line {
  white-space: pre-line !important;
}

.contrato-preview .border-t-2 {
  border-top: 2px solid #1f2937 !important;
  padding-top: 0.5rem;
}

.contrato-preview .text-sm {
  font-size: 12px !important;
}

.contrato-preview .grid {
  display: grid !important;
}

.contrato-preview .grid-cols-2 {
  grid-template-columns: repeat(2, 1fr) !important;
}

.contrato-preview .gap-8 {
  gap: 2rem !important;
}

.contrato-preview .w-64 {
  width: 16rem !important;
}

.contrato-preview .mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}

.contrato-preview .mb-2 {
  margin-bottom: 0.5rem !important;
}

/* ========================================
   Modal
   ======================================== */

#modal-preview {
  animation: fadeIn 0.3s ease-in-out;
  backdrop-filter: blur(4px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Garantir que o preview fique centralizado */
#modal-preview-content {
  min-height: 200px;
  max-height: 70vh;
  overflow-y: auto;
}

/* Scrollbar customizada */
#modal-preview-content::-webkit-scrollbar {
  width: 8px;
}

#modal-preview-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

#modal-preview-content::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

#modal-preview-content::-webkit-scrollbar-thumb:hover {
  background: #b01d23;
}

/* ========================================
   Toast Notifications
   ======================================== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
}

.toast {
  background: white;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.danger {
  border-left: 4px solid var(--danger);
}

.toast.warning {
  border-left: 4px solid var(--warning);
}

.toast.info {
  border-left: 4px solid #3b82f6;
}

.toast i {
  font-size: 24px;
}

.toast.success i {
  color: var(--success);
}

.toast.danger i {
  color: var(--danger);
}

.toast.warning i {
  color: var(--warning);
}

.toast.info i {
  color: #3b82f6;
}

/* ========================================
   Loading Overlay
   ======================================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ========================================
   Botões
   ======================================== */

.btn-primary {
  background: var(--primary);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: #b01d23;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(217, 35, 42, 0.3);
}

/* ========================================
   Animações
   ======================================== */

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-bounce {
  animation: bounce 1s infinite;
}

/* ========================================
   Responsivo
   ======================================== */

@media (max-width: 768px) {
  .contrato-preview {
    padding: 1.5rem;
    font-size: 12px;
  }

  .contrato-preview h1 {
    font-size: 16px !important;
  }

  .contrato-preview h2 {
    font-size: 13px !important;
  }

  .toast-container {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* ========================================
   Utilitários
   ======================================== */

.text-primary {
  color: var(--primary) !important;
}

.bg-primary {
  background-color: var(--primary) !important;
}

.border-primary {
  border-color: var(--primary) !important;
}
