/* Modal + form (Zohra Lara tokens) */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 5, 3, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 32rem;
  max-height: calc(100svh - 2rem);
  overflow-y: auto;
  padding: 2.5rem 2rem 2rem;
  background: #fffdf8;
  border-radius: 1.5rem;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
  transform: scale(0.96) translateY(12px);
  transition: transform 0.25s ease;
}

.modal.is-open .modal__dialog {
  transform: scale(1) translateY(0);
}

.modal__close {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  color: #6f6254;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.modal__close:hover {
  background: #f6eddf;
  color: #21170e;
}

.modal__header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.modal__title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  color: #21170e;
  margin: 0;
}

.modal__subtitle {
  font-size: 0.9rem;
  color: #6f6254;
  margin-top: 0.5rem;
  line-height: 1.5;
}

.modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.25rem 0;
  font-size: 0.8rem;
  color: #6f6254;
}

.modal__divider::before,
.modal__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5d6c2;
}

.modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.9rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.modal-btn:hover {
  transform: translateY(-2px);
}

.modal-btn--primary {
  color: var(--primary-foreground);
  background: linear-gradient(135deg, var(--primary-glow), var(--primary));
  box-shadow: 0 10px 28px rgba(199, 122, 0, 0.35);
}

.modal-btn--primary:hover {
  box-shadow: 0 14px 34px rgba(199, 122, 0, 0.45);
}

.modal-btn--neutral {
  color: #6f6254;
  background: #f6eddf;
  box-shadow: none;
}

.modal-btn--neutral:hover {
  background: #f0e3d1;
}

.modal-btn--whatsapp {
  color: var(--whatsapp-foreground);
  background: var(--whatsapp);
  box-shadow: 0 10px 28px rgba(61, 180, 74, 0.35);
  text-decoration: none;
}

.modal-btn--whatsapp:hover {
  background: #34a043;
  box-shadow: 0 14px 34px rgba(61, 180, 74, 0.45);
  color: var(--whatsapp-foreground);
}

.modal .form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal .form-input,
.modal .form-select {
  width: 100%;
  padding: 0.9rem 1.1rem;
  min-height: 3.25rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: #21170e;
  background: #f6eddf;
  border: 2px solid transparent;
  border-radius: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.modal .form-input:focus,
.modal .form-select:focus {
  outline: none;
  background: #fffdf8;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(199, 122, 0, 0.2);
}

.modal .form-input::placeholder {
  color: #a59d91;
}

.modal .form-select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-start: 3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236f6254' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1.125rem center;
  background-size: 0.875rem;
  cursor: pointer;
}

.modal .form-select:invalid {
  color: #a59d91;
}

.form-status {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid transparent;
}

.form-status--success {
  background: #e8f5ee;
  color: #1b6a3a;
  border-color: #b7e0c6;
}

.form-status--error {
  background: #fdecec;
  color: #9b1c1c;
  border-color: #f5b8b8;
}

.quote-form .form-status {
  margin-top: 1rem;
}

.modal button[aria-busy="true"],
.quote-form button[aria-busy="true"] {
  opacity: 0.75;
  cursor: progress;
}

@media (max-width: 520px) {
  .modal__dialog {
    padding: 2rem 1.25rem 1.5rem;
  }

  .modal__title {
    font-size: 1.15rem;
  }
}
