/* ══════════════════════════════════════════════════════════════
   🎨 MODALES FRAPPE - RECREADO DESDE CERO
   ══════════════════════════════════════════════════════════════ */

/* 🎯 RESET Y BASE DEL MODAL */
.modal {
  --bs-modal-zindex: 1055;
  --bs-modal-width: 520px;
  --bs-modal-padding: 0;
  --bs-modal-margin: 0.5rem;
  --bs-modal-bg: white;
  --bs-modal-border-color: transparent;
  --bs-modal-border-width: 0;
  --bs-modal-border-radius: 8px;
  --bs-modal-box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* 🎯 BACKDROP MÁS OSCURO */
.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

/* 🎯 DIALOG CONTAINER */
.modal-dialog {
  max-width: 520px;
  margin: 1.75rem auto;
}

.modal-dialog-centered {
  min-height: calc(100% - 3.5rem);
}

/* 🎯 MODAL CONTENT */
.modal-content {
  border: none;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  background: white;
}

/* 🎯 HEADER ESTILO FRAPPE */
.modal-header {
  background: white;
  border-bottom: none; /* Sin borde */
  padding: 1.5rem 1.5rem 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #212529;
  margin: 0;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* 🎯 CLOSE BUTTON FRAPPE STYLE */
.btn-close {
  background: transparent;
  border: none;
  opacity: 1;
  padding: 0;
  margin: -0.25rem -0.5rem -0.25rem 0;
  width: 1.5rem;
  height: 1.5rem;
  color: #6c757d;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.btn-close::before {
  content: '×';
  display: block;
}

.btn-close:hover {
  color: #000;
  opacity: 1;
}

/* 🎯 BODY */
.modal-body {
  padding: 1.5rem;
  background: white;
}

/* 🎯 FOOTER */
.modal-footer {
  background: white;
  border-top: none;
  padding: 0 1.5rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ══════════════════════════════════════════════════════════════
   🎨 FORM ELEMENTS FRAPPE STYLE
   ══════════════════════════════════════════════════════════════ */

/* 🎯 FORM LAYOUT */
.modal-body .row {
  margin: 0 -0.5rem;
}

.modal-body .col,
.modal-body .col-6,
.modal-body .col-md-6,
.modal-body .col-4,
.modal-body .col-md-4 {
  padding: 0 0.5rem;
}

/* 🎯 FORM GROUPS */
.modal-body .mb-3,
.modal-body .form-group {
  margin-bottom: 1rem;
}

/* 🎯 LABELS */
.modal-body label,
.modal-body .form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 0.375rem;
  text-transform: none;
  letter-spacing: 0;
}

/* 🎯 REQUIRED ASTERISK */
.modal-body label .required,
.modal-body label:has(+ input:required)::after {
  content: ' *';
  color: #dc3545;
}

/* 🎯 INPUT FIELDS */
.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input[type="number"],
.modal-body input[type="tel"],
.modal-body input[type="password"],
.modal-body textarea,
.modal-body select,
.modal-body .form-control,
.modal-body .form-select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #f8f9fa;
  background-clip: padding-box;
  border: 1px solid #f8f9fa;
  border-radius: 4px;
  transition: border-color 0.15s ease-in-out, background-color 0.15s ease-in-out;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* 🎯 PLACEHOLDER */
.modal-body input::placeholder,
.modal-body textarea::placeholder,
.modal-body .form-control::placeholder {
  color: #adb5bd;
  opacity: 1;
}

/* 🎯 FOCUS STATE */
.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus,
.modal-body .form-control:focus,
.modal-body .form-select:focus {
  background-color: white;
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 🎯 SELECT DROPDOWN */
.modal-body select,
.modal-body .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
}

/* ══════════════════════════════════════════════════════════════
   🎨 BUTTONS FRAPPE STYLE
   ══════════════════════════════════════════════════════════════ */

/* 🎯 PRIMARY BUTTON (Create) */
.modal-footer .btn-primary,
.modal-footer button[type="submit"],
.modal-footer .btn-create {
  background-color: #212529;
  border: 1px solid #212529;
  color: white;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  min-width: 70px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1;
}

.modal-footer .btn-primary:hover,
.modal-footer button[type="submit"]:hover,
.modal-footer .btn-create:hover {
  background-color: #000;
  border-color: #000;
  transform: none;
  box-shadow: none;
}

/* 🎯 SECONDARY BUTTON */
.modal-footer .btn-secondary,
.modal-footer .btn-cancel {
  background-color: white;
  border: 1px solid #dee2e6;
  color: #495057;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  min-width: 70px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1;
}

.modal-footer .btn-secondary:hover,
.modal-footer .btn-cancel:hover {
  background-color: #f8f9fa;
  border-color: #adb5bd;
  color: #495057;
}

/* ══════════════════════════════════════════════════════════════
   🎨 ICONS IN MODAL
   ══════════════════════════════════════════════════════════════ */

/* 🎯 ICON BUTTONS */
.modal-header .icon-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  margin-left: 0.5rem;
}

.modal-header .icon-btn:hover {
  background-color: #f8f9fa;
  color: #495057;
}

/* 🎯 FIELD ICONS */
.input-group-text {
  background-color: #f8f9fa;
  border: 1px solid #f8f9fa;
  color: #6c757d;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
}

/* ══════════════════════════════════════════════════════════════
   🎨 RADIO BUTTONS FRAPPE STYLE
   ══════════════════════════════════════════════════════════════ */

.modal-body .form-check {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-left: 0;
}

.modal-body .form-check-input {
  width: 1rem;
  height: 1rem;
  margin-top: 0;
  margin-right: 0.5rem;
  background-color: white;
  border: 2px solid #dee2e6;
  cursor: pointer;
}

.modal-body .form-check-input:checked {
  background-color: #212529;
  border-color: #212529;
}

.modal-body .form-check-label {
  font-size: 0.875rem;
  color: #212529;
  cursor: pointer;
  margin-bottom: 0;
}

/* ══════════════════════════════════════════════════════════════
   🎨 RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 576px) {
  .modal-dialog {
    max-width: calc(100% - 1rem);
    margin: 0.5rem;
  }
  
  .modal-content {
    border-radius: 0.5rem;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }
}

/* ══════════════════════════════════════════════════════════════
   🎨 UTILITIES
   ══════════════════════════════════════════════════════════════ */

/* Para centrar verticalmente el modal */
.modal.show {
  display: flex !important;
  align-items: center;
  min-height: 100%;
}

/* Animación suave */
.modal.fade .modal-dialog {
  transition: transform 0.2s ease-out;
  transform: scale(0.95) translateY(-10px);
}

.modal.show .modal-dialog {
  transform: scale(1) translateY(0);
}