/* ============================================================
   MODALS
============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,28,46,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal-panel {
  background: white;
  border-radius: var(--r-xl);
  padding: 44px;
  max-width: 560px;
  width: 100%;
  position: relative;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-backdrop.open .modal-panel {
  transform: translateY(0) scale(1);
}

.modal-x {
  position: absolute;
  top: 18px; right: 18px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-200);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: all 0.2s;
}

.modal-x:hover {
  background: var(--gray-50);
  color: var(--dark);
  border-color: var(--gray-300);
}

.modal-panel h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

/* ── Demo Modal ── */
.modal-panel--video { max-width: 580px; }

.demo-screen {
  background: var(--dark);
  border-radius: var(--r-md);
  height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.demo-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(135,206,235,0.08), rgba(64,224,208,0.06));
}

.demo-play {
  width: 64px; height: 64px;
  background: var(--grad-cta);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-teal);
  position: relative;
  z-index: 1;
}

.demo-play:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(64,224,208,0.5);
}

.demo-progress-wrap {
  width: 75%;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--r-full);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.demo-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--grad-cta);
  border-radius: var(--r-full);
  transition: width 0.1s linear;
}

.demo-time {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  font-family: 'Courier New', monospace;
  position: relative;
  z-index: 1;
}

.modal-caption {
  font-size: 0.88rem;
  color: var(--gray-500);
  text-align: center;
}

/* ── Success Modal ── */
.modal-panel--success {
  text-align: center;
  padding: 52px 44px;
}

.success-anim {
  position: relative;
  width: 72px; height: 72px;
  margin: 0 auto 20px;
}

.success-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--teal);
  animation: successRing 0.6s ease forwards;
}

@keyframes successRing {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.success-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  animation: successCheck 0.4s ease 0.3s both;
}

@keyframes successCheck {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

.modal-panel--success h2 {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.modal-panel--success p {
  font-size: 0.95rem;
  color: var(--gray-500);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ── Legal Modal ── */
.modal-panel--legal { max-width: 640px; }

.modal-panel--legal h2 { margin-bottom: 16px; }

.modal-panel--legal p {
  font-size: 0.88rem;
  color: var(--gray-500);
  line-height: 1.8;
  margin-bottom: 12px;
}

/* ── Portfolio Modal ── */
.pm-visual {
  height: 200px;
  border-radius: var(--r-md);
  margin-bottom: 20px;
}

.pm-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--teal-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(64,224,208,0.1);
  padding: 3px 10px;
  border-radius: var(--r-full);
  margin-bottom: 12px;
}

.pm-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.pm-desc {
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.7;
  margin-bottom: 20px;
}

.pm-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.pm-meta-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-size: 0.78rem;
  color: var(--gray-500);
}

.pm-meta-item strong {
  display: block;
  font-size: 0.82rem;
  color: var(--dark);
  font-weight: 700;
  margin-bottom: 1px;
}

/* Responsive */
@media (max-width: 768px) {
  .modal-panel { max-width: 90%; }
  .modal-panel--legal { max-width: 95%; }
}

@media (max-width: 640px) {
  .modal-panel { padding: 28px 22px; max-width: 95%; }
  .modal-panel--success { padding: 40px 22px; }
  .modal-panel h2 { font-size: 1.5rem; }
  .modal-panel--legal h2 { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .modal-panel { padding: 24px 18px; }
  .modal-x { top: 12px; right: 12px; }
}
