/* RootZone — unified app modal system */
.rz-modal-root {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.rz-modal-root__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
}

.rz-modal-root__panel {
  position: relative;
  width: min(100%, 520px);
  max-height: min(88vh, 720px);
  overflow: auto;
  border-radius: 22px;
  border: 2px solid rgba(230, 57, 70, 0.55);
  background: linear-gradient(180deg, #161616 0%, #101010 100%);
  box-shadow: 0 0 60px rgba(230, 57, 70, 0.22), 0 24px 64px rgba(0, 0, 0, 0.55);
  padding: 28px 24px 24px;
  text-align: center;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.26s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

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

.rz-modal-root--sm .rz-modal-root__panel { width: min(100%, 380px); padding: 22px 20px 20px; }
.rz-modal-root--md .rz-modal-root__panel { width: min(100%, 520px); }
.rz-modal-root--lg .rz-modal-root__panel { width: min(100%, 680px); text-align: right; }

.rz-modal-root__scan {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #e63946, #ff1744, #e63946, transparent);
  animation: rzModalScan 2.2s linear infinite;
}

@keyframes rzModalScan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.rz-modal-root__icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  border: 2px solid currentColor;
  animation: rzModalPulse 1.6s ease-in-out infinite;
}

@keyframes rzModalPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.35); }
  50% { box-shadow: 0 0 22px 8px rgba(230, 57, 70, 0.12); }
}

.rz-modal-root--success .rz-modal-root__icon { color: #4caf50; background: rgba(76, 175, 80, 0.12); border-color: #4caf50; }
.rz-modal-root--error .rz-modal-root__icon { color: #ff5252; background: rgba(255, 82, 82, 0.12); border-color: #ff5252; }
.rz-modal-root--warning .rz-modal-root__icon { color: #ff9800; background: rgba(255, 152, 0, 0.12); border-color: #ff9800; }
.rz-modal-root--info .rz-modal-root__icon { color: #42a5f5; background: rgba(66, 165, 245, 0.12); border-color: #42a5f5; }
.rz-modal-root--confirm .rz-modal-root__icon { color: #e63946; background: rgba(230, 57, 70, 0.12); border-color: #e63946; }

.rz-modal-root__title {
  margin: 0 0 10px;
  font-size: clamp(1.15rem, 4vw, 1.55rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.45;
}

.rz-modal-root__message {
  margin: 0 0 12px;
  color: #c8c8c8;
  font-size: 0.98rem;
  line-height: 1.75;
}

.rz-modal-root__details {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #aaa;
  font-size: 0.9rem;
  line-height: 1.65;
  text-align: right;
  max-height: 220px;
  overflow: auto;
}

.rz-modal-root__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.rz-modal-root__btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, background 0.15s ease;
}

.rz-modal-root__btn:active { transform: scale(0.98); }

.rz-modal-root__btn--primary {
  background: linear-gradient(135deg, #e63946, #b91c1c);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.08);
}

.rz-modal-root__btn--secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #eee;
  border-color: rgba(255, 255, 255, 0.14);
}

.rz-modal-root__btn--ghost {
  background: transparent;
  color: #bbb;
  border-color: rgba(255, 255, 255, 0.12);
}

.rz-modal-root__close {
  position: absolute;
  top: 12px;
  left: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #888;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.rz-modal-root__close:hover { color: #e63946; }

/* Guest legal banner */
.rz-legal-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 8500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.98), rgba(26, 14, 18, 0.98));
  border: 1px solid rgba(230, 57, 70, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.rz-legal-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.rz-legal-banner__text {
  flex: 1 1 220px;
  margin: 0;
  color: #ddd;
  font-size: 0.92rem;
  line-height: 1.65;
}

.rz-legal-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rz-legal-banner__btn {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.rz-legal-banner__btn--primary {
  background: linear-gradient(135deg, #e63946, #b91c1c);
  border-color: transparent;
}

@media (max-width: 480px) {
  .rz-modal-root__panel { padding: 24px 18px 18px; border-radius: 18px; }
  .rz-modal-root__icon { width: 72px; height: 72px; font-size: 2rem; }
  .rz-modal-root__actions { flex-direction: column; }
  .rz-modal-root__btn { width: 100%; }
  .rz-legal-banner { left: 12px; right: 12px; }
}
