/* =========================================
   THE MICROSITE — CONVERSION SYSTEM UI
   Clean • Calm • System-first
========================================= */

/* -----------------------------
   ROOT
----------------------------- */
#ms-conversion-root {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 9999);
  pointer-events: none;
  font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
}

#ms-conversion-root[data-state^="step-"] {
  pointer-events: auto;
}


/* -----------------------------
   OVERLAY
----------------------------- */
.ms-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 26, 33, 0.84);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.35s var(--ease-standard);
  z-index: 5;
}

#ms-conversion-root[data-state^="step-"] .ms-overlay {
  opacity: 1;
}


/* -----------------------------
   MODAL BASE
----------------------------- */
.ms-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.35s var(--ease-standard), transform 0.35s var(--ease-standard);
  pointer-events: none;
  z-index: 10;
}

.ms-modal[aria-hidden="false"] {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}


/* -----------------------------
   CARD
----------------------------- */
.ms-modal__card {
  width: min(100%, 460px);
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
  position: relative;
  animation: msFadeUp 0.35s var(--ease-standard);
}

@keyframes msFadeUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* -----------------------------
   COMPACT VARIANTS
----------------------------- */
.ms-modal__card--compact {
  max-width: 380px;
  padding: 1.5rem;
}


/* -----------------------------
   CLOSE BUTTON
----------------------------- */
.ms-modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 0.2s var(--ease-standard), background 0.2s var(--ease-standard), transform 0.2s var(--ease-standard);
}

.ms-modal__close:hover,
.ms-modal__close:focus-visible {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.05);
}


/* -----------------------------
   TYPOGRAPHY
----------------------------- */
.ms-title {
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  font-weight: 600;
  margin-bottom: 1.1rem;
  line-height: 1.4;
}

.ms-text {
  font-size: 0.96rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
}


/* -----------------------------
   FORM SYSTEM
----------------------------- */
.ms-field {
  margin-bottom: 1rem;
}

.ms-input,
.ms-textarea,
.ms-select {
  width: 100%;
  padding: 0.95rem 1rem;
  background: rgba(17, 30, 39, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s var(--ease-standard), background 0.2s var(--ease-standard);
}

.ms-input:focus,
.ms-textarea:focus,
.ms-select:focus {
  border-color: rgba(93, 220, 255, 0.7);
  background: rgba(12, 27, 37, 1);
}

.ms-textarea {
  resize: none;
  min-height: 100px;
}


/* -----------------------------
   BUTTONS
----------------------------- */
.ms-btn {
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s var(--ease-standard), background 0.2s var(--ease-standard), color 0.2s var(--ease-standard);
}

.ms-btn--primary {
  background: var(--color-accent);
  color: #051f28;
}

.ms-btn--primary:hover,
.ms-btn--primary:focus-visible {
  background: var(--color-accent-alt);
}

.ms-btn--ghost {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ms-btn--ghost:hover,
.ms-btn--ghost:focus-visible {
  color: var(--color-accent-alt);
  border-color: rgba(93, 220, 255, 0.5);
}

.ms-btn--full {
  width: 100%;
}

.ms-btn:focus-visible {
  outline: 2px solid rgba(93, 220, 255, 0.45);
  outline-offset: 3px;
}


/* -----------------------------
   ACTIONS
----------------------------- */
.ms-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}


/* -----------------------------
   RESPONSE LAYER
----------------------------- */
.ms-modal--response .ms-title {
  text-align: center;
}

.ms-modal--response .ms-text {
  text-align: center;
  margin-bottom: 1.25rem;
}


/* -----------------------------
   MOBILE OPTIMIZATION
----------------------------- */
@media (max-width: 600px) {
  .ms-modal {
    align-items: flex-end;
  }

  .ms-modal--expanded {
    align-items: center;
  }

  .ms-modal__card {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 1.4rem;
  }

  .ms-modal--expanded .ms-modal__card {
    border-radius: var(--radius-lg);
    max-height: 80vh;
    overflow-y: auto;
  }

  .ms-title {
    font-size: 1.15rem;
  }
}

/* =========================================
   MICRO INTERACTIONS — THE MICROSITE
========================================= */

/* Button press feel */
.ms-btn {
  transform: translateY(0);
}

.ms-btn:active {
  transform: translateY(1px) scale(0.98);
}


/* Input focus glow */
.ms-input:focus,
.ms-textarea:focus,
.ms-select:focus {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
}


/* Modal breathing effect (subtle life) */
.ms-modal__card {
  will-change: transform, opacity;
}


/* Step transition smoothness */
.ms-modal {
  transition: 
    opacity 0.35s ease,
    transform 0.35s ease;
}


/* Overlay soft fade */
.ms-overlay {
  transition: opacity 0.7s ease;
}


/* Close button micro feedback */
.ms-modal__close:active {
  transform: scale(0.9);
}


/* CTA hover (very subtle) */
.ms-btn--primary:hover {
  transform: translateY(-1px);
}


/* Form field hover */
.ms-input:hover,
.ms-textarea:hover,
.ms-select:hover {
  border-color: #3a3a3a;
}