/**
 * Ship Care Service - Get a Quote Modal Styles
 * Ultra-smooth opening transition, rich aesthetics, glassmorphism & responsive form layout.
 */

:root {
  --sc-modal-z: 999999;
  --sc-modal-bg: #071938;
  --sc-modal-blue: #0b84f3;
  --sc-modal-cyan: #00d2ff;
}

/* Modal Overlay & Backdrop */
.sc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--sc-modal-z);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.36s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.36s ease;
  perspective: 1200px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 26, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1;
  transition: opacity 0.36s ease;
}

/* Modal Open State */
.sc-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Modal Container & 3D Spring Animation */
.sc-modal-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 580px;
  margin: auto;
  transform: scale(0.88) translateY(30px) rotateX(6deg);
  opacity: 0;
  filter: blur(4px);
  transition: transform 0.44s cubic-bezier(0.175, 0.885, 0.32, 1.15),
              opacity 0.34s ease,
              filter 0.34s ease;
  will-change: transform, opacity;
}

.sc-modal-overlay.is-active .sc-modal-container {
  transform: scale(1) translateY(0) rotateX(0deg);
  opacity: 1;
  filter: blur(0);
}

/* Ambient Glow Orbs behind card */
.sc-modal-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(35px);
  opacity: 0.7;
}

.sc-modal-glow-tl {
  top: -40px;
  left: -40px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(11, 132, 243, 0.4) 0%, transparent 70%);
}

.sc-modal-glow-br {
  bottom: -40px;
  right: -40px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.3) 0%, transparent 70%);
}

/* Floating Glass Close Button */
.sc-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0;
}

.sc-modal-close:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.6);
  transform: rotate(90deg) scale(1.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.sc-modal-close:focus-visible {
  outline: 2px solid var(--sc-modal-cyan);
  outline-offset: 2px;
}

/* Modal Form Card Styling */
.sc-modal-card.sc-cnt-form-box {
  position: relative;
  z-index: 1;
  background: linear-gradient(165deg, #09214A 0%, #061838 45%, #041026 100%);
  border-radius: 26px;
  padding: 38px 34px 34px;
  border: 1px solid rgba(124, 192, 255, 0.28);
  box-shadow: 0 28px 70px -15px rgba(2, 8, 24, 0.75),
              0 0 40px rgba(11, 132, 243, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  box-sizing: border-box;
}

/* Header */
.sc-modal-card .sc-cnt-form-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-right: 32px; /* space for close button */
}

.sc-modal-card .sc-cnt-form-badge-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, rgba(11, 132, 243, 0.3) 0%, rgba(0, 210, 255, 0.1) 100%);
  border: 1.5px solid rgba(11, 132, 243, 0.55);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00d2ff;
  box-shadow: 0 8px 20px -4px rgba(11, 132, 243, 0.45);
  flex-shrink: 0;
}

.sc-modal-card .sc-cnt-form-badge-icon svg {
  width: 24px;
  height: 24px;
}

.sc-modal-card .sc-cnt-form-kicker {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00d2ff;
  display: block;
  margin-bottom: 3px;
}

.sc-modal-card .sc-cnt-form-h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.sc-modal-card .sc-cnt-form-sub {
  font-size: 0.86rem;
  color: rgba(226, 238, 252, 0.78);
  margin: 0;
  line-height: 1.45;
}

/* Form Layout */
.sc-modal-card .sc-cnt-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sc-modal-card .sc-cnt-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.sc-modal-card .sc-cnt-row-full {
  grid-template-columns: 1fr;
}

.sc-modal-card .sc-cnt-field {
  position: relative;
}

.sc-modal-card .sc-cnt-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sc-modal-card .sc-cnt-f-icon {
  position: absolute;
  left: 15px;
  width: 17px;
  height: 17px;
  color: #64748B;
  pointer-events: none;
  transition: color 0.25s ease;
  z-index: 2;
}

.sc-modal-card input[type="text"],
.sc-modal-card input[type="email"],
.sc-modal-card select,
.sc-modal-card textarea {
  width: 100%;
  box-sizing: border-box;
  background: #FFFFFF;
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 12px 14px 12px 42px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: #0f172a;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sc-modal-card input::placeholder,
.sc-modal-card textarea::placeholder {
  color: #94A3B8;
  font-weight: 400;
}

.sc-modal-card input:focus,
.sc-modal-card select:focus,
.sc-modal-card textarea:focus {
  border-color: #0b84f3;
  box-shadow: 0 0 0 3.5px rgba(11, 132, 243, 0.28);
}

.sc-modal-card .sc-cnt-input-wrap:focus-within .sc-cnt-f-icon {
  color: #0b84f3;
}

/* Select */
.sc-modal-card .sc-cnt-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 38px;
}

.sc-modal-card .sc-cnt-select-arrow {
  position: absolute;
  right: 15px;
  width: 16px;
  height: 16px;
  color: #64748B;
  pointer-events: none;
  transition: transform 0.25s ease;
}

.sc-modal-card .sc-cnt-select-wrap:focus-within .sc-cnt-select-arrow {
  color: #0b84f3;
  transform: rotate(180deg);
}

/* Textarea */
.sc-modal-card textarea {
  resize: vertical;
  min-height: 84px;
  padding-top: 12px;
}

/* File Upload Dropzone */
.sc-modal-card .sc-cnt-file-box {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px dashed rgba(124, 192, 255, 0.35);
  border-radius: 12px;
  padding: 13px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sc-modal-card .sc-cnt-file-box:hover,
.sc-modal-card .sc-cnt-file-box.dragover,
.sc-modal-card .sc-cnt-file-box.has-file {
  background: rgba(11, 132, 243, 0.12);
  border-color: #00d2ff;
}

.sc-modal-card .sc-cnt-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}

.sc-modal-card .sc-cnt-file-content {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  overflow: hidden;
}

.sc-modal-card .sc-cnt-file-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(11, 132, 243, 0.2);
  border: 1px solid rgba(11, 132, 243, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00d2ff;
  flex-shrink: 0;
}

.sc-modal-card .sc-cnt-file-icon svg {
  width: 18px;
  height: 18px;
}

.sc-modal-card .sc-cnt-file-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.sc-modal-card .sc-cnt-file-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-modal-card .sc-cnt-file-sub {
  font-size: 0.74rem;
  color: rgba(226, 238, 252, 0.65);
}

.sc-modal-card .sc-file-clear-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  z-index: 4;
  transition: background 0.2s;
}

.sc-modal-card .sc-file-clear-btn:hover {
  background: rgba(239, 68, 68, 0.7);
}

/* Submit Button */
.sc-modal-card .sc-cnt-submit-row {
  margin-top: 6px;
}

.sc-modal-card .sc-cnt-submit-btn {
  width: 100%;
  min-height: 52px;
  padding: 13px 28px;
  background: linear-gradient(135deg, #0B84F3 0%, #006ee0 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 24px -4px rgba(11, 132, 243, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.25s ease,
              background 0.25s ease;
  position: relative;
  overflow: hidden;
}

.sc-modal-card .sc-cnt-submit-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #1f92ff 0%, #0b84f3 100%);
  box-shadow: 0 16px 32px -4px rgba(11, 132, 243, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.sc-modal-card .sc-cnt-submit-btn:active {
  transform: translateY(0);
}

.sc-modal-card .sc-cnt-btn-icon,
.sc-modal-card .sc-cnt-btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}

.sc-modal-card .sc-cnt-submit-btn:hover .sc-cnt-btn-arrow {
  transform: translateX(4px);
}

/* Button Loading Spinner */
.sc-modal-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: scSpin 0.75s linear infinite;
}

.sc-modal-submit-btn.is-loading .sc-cnt-btn-icon,
.sc-modal-submit-btn.is-loading .sc-cnt-btn-arrow,
.sc-modal-submit-btn.is-loading .sc-btn-label {
  display: none;
}

.sc-modal-submit-btn.is-loading .sc-modal-spinner {
  display: inline-block;
}

@keyframes scSpin {
  to { transform: rotate(360deg); }
}

/* Alert Notification */
.sc-modal-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 14px;
  line-height: 1.4;
}

.sc-modal-alert.is-error {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

/* Success State Overlay */
.sc-modal-success-state {
  text-align: center;
  padding: 24px 12px 12px;
  animation: scFadeUp 0.4s ease forwards;
}

@keyframes scFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.sc-success-icon-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.sc-success-checkmark {
  width: 44px;
  height: 44px;
  stroke: #10B981;
  stroke-width: 3.5;
  stroke-miterlimit: 10;
}

.sc-success-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3.5;
  stroke: #10B981;
  fill: none;
  animation: scStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.sc-success-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: scStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

@keyframes scStroke {
  100% { stroke-dashoffset: 0; }
}

.sc-modal-success-state h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 10px;
}

.sc-modal-success-state p {
  color: rgba(226, 238, 252, 0.85);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 440px;
  margin: 0 auto 24px;
}

.sc-modal-done-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 36px;
  background: #10B981;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

.sc-modal-done-btn:hover {
  background: #059669;
  transform: translateY(-2px);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .sc-modal-overlay {
    padding: 12px;
  }
  .sc-modal-card.sc-cnt-form-box {
    padding: 30px 20px 24px;
    border-radius: 20px;
  }
  .sc-modal-card .sc-cnt-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .sc-modal-card .sc-cnt-form-h2 {
    font-size: 1.55rem;
  }
  .sc-modal-close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
}
