/* ============================================================
   MODAL — modal.css
   Premium dark-glass enquiry form modal
   ============================================================ */

/* ══════════════════════════════════════════════════════════
   BACKDROP OVERLAY
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position        : fixed;
  inset           : 0;
  z-index         : 9000;
  background      : rgba(2, 2, 10, 0.82);
  backdrop-filter : blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display         : flex;
  align-items     : center;
  justify-content : center;
  padding         : 20px;

  /* Hidden by default */
  opacity         : 0;
  pointer-events  : none;
  transition      : opacity 0.35s cubic-bezier(0.16,1,0.3,1);
}
.modal-overlay.open {
  opacity       : 1;
  pointer-events: all;
}

/* ══════════════════════════════════════════════════════════
   MODAL CARD
══════════════════════════════════════════════════════════ */
.modal-card {
  position        : relative;
  width           : 100%;
  max-width       : 560px;
  max-height      : 90dvh;
  overflow-y      : auto;
  background      : rgba(12, 10, 28, 0.94);
  border          : 1px solid rgba(255,255,255,0.09);
  border-radius   : 20px;
  padding         : 40px 40px 36px;
  box-shadow      : 0 0 0 1px rgba(130,80,255,0.10),
                    0 32px 80px rgba(0,0,0,0.65),
                    0 0 80px rgba(90,30,200,0.08);

  /* Enter animation */
  transform       : translateY(24px) scale(0.97);
  transition      : transform 0.4s cubic-bezier(0.16,1,0.3,1);

  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.10) transparent;
}
.modal-card::-webkit-scrollbar       { width: 4px; }
.modal-card::-webkit-scrollbar-track { background: transparent; }
.modal-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 99px; }

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

/* Subtle inner glow */
.modal-card::before {
  content        : '';
  position       : absolute;
  top            : 0; left: 0; right: 0;
  height         : 180px;
  background     : radial-gradient(ellipse at 50% -10%, rgba(120,60,255,0.12) 0%, transparent 70%);
  border-radius  : 20px 20px 0 0;
  pointer-events : none;
}

/* ══════════════════════════════════════════════════════════
   MODAL HEADER
══════════════════════════════════════════════════════════ */
.modal-header {
  display        : flex;
  align-items    : flex-start;
  justify-content: space-between;
  gap            : 16px;
  margin-bottom  : 6px;
}

.modal-eyebrow {
  font-family   : 'Inter', sans-serif;
  font-size     : 0.72rem;
  font-weight   : 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color         : rgba(160,120,255,0.85);
  margin-bottom : 8px;
}

.modal-title {
  font-family   : 'Inter', sans-serif;
  font-size     : 1.65rem;
  font-weight   : 800;
  letter-spacing: -0.025em;
  color         : #ffffff;
  line-height   : 1.15;
  margin        : 0;
}

.modal-subtitle {
  font-family  : 'Inter', sans-serif;
  font-size    : 0.85rem;
  color        : rgba(255,255,255,0.38);
  margin-top   : 6px;
  line-height  : 1.5;
}

/* ── Close button ── */
.modal-close {
  width          : 36px;
  height         : 36px;
  flex-shrink    : 0;
  border-radius  : 50%;
  background     : rgba(255,255,255,0.06);
  border         : 1px solid rgba(255,255,255,0.10);
  color          : rgba(255,255,255,0.55);
  font-size      : 1.1rem;
  display        : flex;
  align-items    : center;
  justify-content: center;
  cursor         : pointer;
  transition     : background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  flex-shrink    : 0;
  margin-top     : 2px;
}
.modal-close:hover {
  background : rgba(255,255,255,0.12);
  color      : #ffffff;
  transform  : rotate(90deg);
}

/* ══════════════════════════════════════════════════════════
   DIVIDER
══════════════════════════════════════════════════════════ */
.modal-divider {
  height         : 1px;
  background     : rgba(255,255,255,0.07);
  margin         : 24px 0;
}

/* ══════════════════════════════════════════════════════════
   FORM GRID
══════════════════════════════════════════════════════════ */
.modal-form {
  display : flex;
  flex-direction: column;
  gap     : 0;
}

.form-grid {
  display              : grid;
  grid-template-columns: 1fr 1fr;
  gap                  : 14px;
}

/* Full-width field */
.form-field-full {
  grid-column: 1 / -1;
}

/* ── Individual field wrapper ── */
.form-field {
  display       : flex;
  flex-direction: column;
  gap           : 7px;
}

.form-label {
  font-family   : 'Inter', sans-serif;
  font-size     : 0.76rem;
  font-weight   : 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color         : rgba(255,255,255,0.40);
}

/* ── Input & Select base ── */
.form-input,
.form-select {
  font-family  : 'Inter', sans-serif;
  font-size    : 0.92rem;
  font-weight  : 400;
  color        : #ffffff;
  background   : rgba(255,255,255,0.04);
  border       : 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  padding      : 12px 15px;
  width        : 100%;
  outline      : none;
  transition   : border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  -webkit-appearance: none;
  appearance   : none;
  line-height  : 1.4;
}

.form-input::placeholder {
  color: rgba(255,255,255,0.22);
}

.form-input:focus,
.form-select:focus {
  border-color: rgba(130,80,255,0.55);
  background  : rgba(130,80,255,0.05);
  box-shadow  : 0 0 0 3px rgba(130,80,255,0.12);
}

/* ── Select — custom arrow ── */
.form-select-wrap {
  position: relative;
}
.form-select-wrap::after {
  content       : '';
  position      : absolute;
  right         : 14px;
  top           : 50%;
  transform     : translateY(-50%);
  width         : 0;
  height        : 0;
  border-left   : 4px solid transparent;
  border-right  : 4px solid transparent;
  border-top    : 5px solid rgba(255,255,255,0.35);
  pointer-events: none;
  transition    : border-color 0.2s ease;
}
.form-select-wrap:focus-within::after {
  border-top-color: rgba(130,80,255,0.80);
}

.form-select {
  cursor      : pointer;
  padding-right: 38px;
}
.form-select option {
  background: #0e0c22;
  color     : #ffffff;
}

/* ══════════════════════════════════════════════════════════
   SUBMIT BUTTON
══════════════════════════════════════════════════════════ */
.modal-submit-wrap {
  margin-top: 22px;
}

.modal-submit {
  width          : 100%;
  padding        : 14px 24px;
  background     : linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border         : none;
  border-radius  : 12px;
  color          : #ffffff;
  font-family    : 'Inter', sans-serif;
  font-size      : 0.95rem;
  font-weight    : 700;
  letter-spacing : -0.01em;
  cursor         : pointer;
  position       : relative;
  overflow       : hidden;
  transition     : transform 0.28s cubic-bezier(0.16,1,0.3,1),
                   box-shadow 0.28s ease,
                   filter 0.28s ease;
  box-shadow     : 0 4px 24px rgba(124,58,237,0.35),
                   0 1px 0 rgba(255,255,255,0.12) inset;
}
.modal-submit::before {
  content     : '';
  position    : absolute;
  inset       : 0;
  background  : linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
  border-radius: 12px;
  pointer-events: none;
}
.modal-submit:hover {
  transform : translateY(-2px);
  box-shadow: 0 8px 36px rgba(124,58,237,0.50),
              0 1px 0 rgba(255,255,255,0.12) inset;
  filter    : brightness(1.08);
}
.modal-submit:active {
  transform: translateY(0);
}

/* Privacy note */
.modal-privacy {
  font-family: 'Inter', sans-serif;
  font-size  : 0.73rem;
  color      : rgba(255,255,255,0.22);
  text-align : center;
  margin-top : 12px;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   SUCCESS STATE
══════════════════════════════════════════════════════════ */
.modal-success {
  display       : none;
  flex-direction: column;
  align-items   : center;
  justify-content: center;
  text-align    : center;
  padding       : 24px 0 8px;
  gap           : 12px;
}
.modal-success.show { display: flex; }

.success-icon {
  width          : 60px;
  height         : 60px;
  border-radius  : 50%;
  background     : linear-gradient(135deg, rgba(124,58,237,0.25), rgba(91,33,182,0.15));
  border         : 1px solid rgba(124,58,237,0.35);
  display        : flex;
  align-items    : center;
  justify-content: center;
  font-size      : 1.6rem;
  margin-bottom  : 4px;
}
.success-title {
  font-family   : 'Inter', sans-serif;
  font-size     : 1.3rem;
  font-weight   : 800;
  color         : #ffffff;
  letter-spacing: -0.02em;
}
.success-msg {
  font-family: 'Inter', sans-serif;
  font-size  : 0.88rem;
  color      : rgba(255,255,255,0.42);
  line-height: 1.6;
  max-width  : 320px;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 768px) {
  .modal-card     { padding: 34px 32px 30px; max-width: 480px; }
  .modal-title    { font-size: 1.5rem; }
  .form-grid      { gap: 12px; }
}

/* Always single-column form on narrower tablets */
@media (max-width: 600px) {
  .form-grid      { grid-template-columns: 1fr; }
  .form-field-full{ grid-column: 1; }
}

/* Mobile — bottom sheet */
@media (max-width: 520px) {
  .modal-overlay  {
    align-items   : flex-end;
    padding       : 0;
  }
  .modal-card     {
    max-width     : 100%;
    width         : 100%;
    border-radius : 20px 20px 0 0;
    max-height    : 92dvh;
    padding       : 28px 20px 32px;
  }
  .modal-title    { font-size: 1.35rem; }
  .modal-subtitle { font-size: 0.8rem; }

  /* Drag handle visual hint */
  .modal-card::after {
    content      : '';
    position     : absolute;
    top          : 10px;
    left         : 50%;
    transform    : translateX(-50%);
    width        : 36px;
    height       : 4px;
    border-radius: 99px;
    background   : rgba(255,255,255,0.14);
  }
}

/* Extra small */
@media (max-width: 360px) {
  .modal-card     { padding: 24px 16px 28px; }
  .modal-title    { font-size: 1.2rem; }
  .modal-eyebrow  { font-size: 0.65rem; }
  .form-input,
  .form-select    { padding: 10px 12px; font-size: 0.85rem; }
  .modal-submit   { padding: 12px 20px; font-size: 0.88rem; }
}

/* Validation Error Styles */
.form-input.invalid,
.form-select.invalid {
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: #fff !important;
}
.form-error-msg {
  color: #ef4444;
  font-size: 0.8rem;
  margin-top: 6px;
  display: none;
  font-weight: 500;
}
.form-error-msg.visible {
  display: block;
  animation: modalFadeIn 0.2s ease forwards;
}
