/* ============================================================
   DreamzYatra – Modals & Forms  Step 2
   modals.css
   ============================================================ */

/* ── Modal Overlay ───────────────────────────────────────── */
.dz-modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  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;
}
.dz-modal-overlay.is-open {
  opacity: 1; visibility: visible; pointer-events: auto;
}

/* ── Modal Box ───────────────────────────────────────────── */
.dz-modal {
  background: var(--dz-white);
  border-radius: var(--dz-r-xl);
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.34,1.4,0.64,1);
  position: relative;
}
.dz-modal-overlay.is-open .dz-modal {
  transform: translateY(0) scale(1);
}
.dz-modal--wide { max-width: 680px; }

/* Close button */
.dz-modal__close {
  position: absolute; top: 1rem; right: 1rem;
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--dz-gray-100); color: var(--dz-text-secondary);
  transition: background var(--dz-t), color var(--dz-t);
  z-index: 1;
}
.dz-modal__close:hover { background: var(--dz-gray-200); color: var(--dz-text-primary); }

/* ── Modal Header ────────────────────────────────────────── */
.dz-modal__header {
  padding: 1.5rem 1.5rem 0;
  text-align: center;
}
.dz-modal__icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--dz-blue-light);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 0.875rem;
  color: var(--dz-blue);
}
.dz-modal__title {
  font-size: 1.25rem; font-weight: 800; color: var(--dz-text-primary);
  margin-bottom: 0.25rem;
}
.dz-modal__subtitle {
  font-size: 0.875rem; color: var(--dz-text-secondary); line-height: 1.5;
}

/* ── Step Progress ───────────────────────────────────────── */
.dz-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0; padding: 1.25rem 1.5rem 0; flex-wrap: nowrap;
}
.dz-step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1;
}
.dz-step__dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  background: var(--dz-gray-100); color: var(--dz-text-muted);
  border: 2px solid var(--dz-gray-200);
  transition: background var(--dz-t), color var(--dz-t), border-color var(--dz-t);
  position: relative; z-index: 1;
}
.dz-step__label { font-size: 0.6875rem; font-weight: 600; color: var(--dz-text-muted); white-space: nowrap; transition: color var(--dz-t); }

.dz-step--active .dz-step__dot  { background: var(--dz-blue); color: #fff; border-color: var(--dz-blue); }
.dz-step--active .dz-step__label { color: var(--dz-blue); }
.dz-step--done .dz-step__dot   { background: #10b981; color: #fff; border-color: #10b981; }
.dz-step--done .dz-step__label { color: #10b981; }

.dz-step__line {
  flex: 1; height: 2px; background: var(--dz-gray-200);
  margin: 0; align-self: flex-start; margin-top: 14px;
  transition: background var(--dz-t);
}
.dz-step__line--done { background: #10b981; }

/* ── Modal Body / Form ───────────────────────────────────── */
.dz-modal__body { padding: 1.25rem 1.5rem 1.5rem; }

/* Form panel – each step is a panel */
.dz-form-panel { display: none; }
.dz-form-panel.is-active { display: block; animation: dz-fade-in 0.22s ease; }

@keyframes dz-fade-in { from { opacity:0; transform:translateX(8px); } to { opacity:1; transform:translateX(0); } }

/* Form fields */
.dz-form-row { display: grid; grid-template-columns: 1fr; gap: 0.875rem; margin-bottom: 0.875rem; }
.dz-form-row--2 { grid-template-columns: 1fr 1fr; }

.dz-field { display: flex; flex-direction: column; gap: 0.375rem; }
.dz-field label {
  font-size: 0.8125rem; font-weight: 700; color: var(--dz-text-primary);
}
.dz-field label span.req { color: #ef4444; margin-left: 2px; }

.dz-input, .dz-select, .dz-textarea {
  width: 100%; padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--dz-gray-300); border-radius: var(--dz-r-md);
  font-family: var(--font-body); font-size: 0.9rem; color: var(--dz-text-primary);
  background: var(--dz-white);
  transition: border-color var(--dz-t), box-shadow var(--dz-t);
  outline: none; -webkit-appearance: none;
}
.dz-input:focus, .dz-select:focus, .dz-textarea:focus {
  border-color: var(--dz-blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.dz-input::placeholder, .dz-textarea::placeholder { color: var(--dz-text-muted); }
.dz-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.dz-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2.25rem; cursor: pointer; }

/* Radio/Checkbox cards */
.dz-option-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.dz-option-card input[type="radio"],
.dz-option-card input[type="checkbox"] { display: none; }
.dz-option-card label {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--dz-gray-200); border-radius: var(--dz-r-md);
  cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--dz-text-secondary);
  transition: border-color var(--dz-t), background var(--dz-t), color var(--dz-t);
}
.dz-option-card input:checked + label {
  border-color: var(--dz-blue); background: var(--dz-blue-soft); color: var(--dz-blue);
}
.dz-option-card label:hover { border-color: var(--dz-blue-dark); }

/* Destination tags (package modal) */
.dz-pkg-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0.4rem 0.875rem;
  background: var(--dz-blue-light); color: var(--dz-blue);
  border-radius: var(--dz-r-pill); font-size: 0.8125rem; font-weight: 700;
  margin: 0 0.25rem 0.375rem 0;
}

/* Error state */
.dz-input.is-error, .dz-select.is-error, .dz-textarea.is-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.dz-field__error { font-size: 0.75rem; color: #ef4444; font-weight: 600; margin-top: -0.125rem; }

/* ── Modal Footer ────────────────────────────────────────── */
.dz-modal__footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; padding-top: 1rem;
  border-top: 1px solid var(--dz-gray-100);
  margin-top: 0.5rem;
}
.dz-modal__footer--right { justify-content: flex-end; }

/* ── Success Screen ──────────────────────────────────────── */
.dz-modal__success {
  text-align: center; padding: 2rem 1.5rem;
}
.dz-modal__success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: #dcfce7; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem; color: #16a34a;
}
.dz-modal__success h3 { font-size: 1.25rem; font-weight: 800; color: var(--dz-text-primary); margin-bottom: 0.5rem; }
.dz-modal__success p { font-size: 0.875rem; color: var(--dz-text-secondary); line-height: 1.6; }

/* ── WhatsApp Floating Button ────────────────────────────── */
.dz-wa-float {
  position: fixed;
  right: 1.25rem;
  bottom: calc(var(--dz-mobile-bar-h) + 0.875rem);
  z-index: 900;
  width: 52px; height: 52px; border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,0.45);
  color: #fff;
  text-decoration: none;
  transition: transform var(--dz-t), box-shadow var(--dz-t);
  -webkit-tap-highlight-color: transparent;
}
.dz-wa-float:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(37,211,102,0.55); }
.dz-wa-float:active { transform: scale(0.97); }

/* Pulse ring */
.dz-wa-float::before {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(37,211,102,0.4);
  animation: dz-wa-pulse 2.4s ease-out infinite;
}
@keyframes dz-wa-pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* Tooltip */
.dz-wa-float__tooltip {
  position: absolute; right: 62px; top: 50%;
  transform: translateY(-50%);
  background: #1a1a1a; color: #fff;
  font-size: 0.75rem; font-weight: 600;
  padding: 0.3rem 0.75rem; border-radius: var(--dz-r-pill);
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--dz-t);
}
.dz-wa-float__tooltip::after {
  content: ''; position: absolute;
  right: -5px; top: 50%; transform: translateY(-50%);
  border: 5px solid transparent; border-right: none;
  border-left-color: #1a1a1a;
}
.dz-wa-float:hover .dz-wa-float__tooltip { opacity: 1; }

/* On desktop, move above bottom of page */
@media (min-width: 768px) {
  .dz-wa-float { bottom: 1.5rem; right: 1.5rem; width: 56px; height: 56px; }
}

/* ── Responsive Modals ───────────────────────────────────── */
@media (max-width: 480px) {
  .dz-modal-overlay { padding: 0; align-items: flex-end; }
  .dz-modal { border-radius: var(--dz-r-xl) var(--dz-r-xl) 0 0; max-height: 92vh; }
  .dz-modal-overlay.is-open .dz-modal { transform: translateY(0); }
  .dz-form-row--2 { grid-template-columns: 1fr; }
  .dz-modal__header { padding: 1.25rem 1.25rem 0; }
  .dz-modal__body { padding: 1rem 1.25rem 1.25rem; }
}
