/* ==========================================
   ELEGANT GRADIENT & RESPONSIVE LEGAL MODAL
   ========================================== */

/* Main Card */
.terms-single-card {
  width: min(580px, 94vw) !important;
  max-height: 88dvh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 24px 24px 20px 24px !important;
  position: relative !important;
  overflow: hidden !important;
  background: linear-gradient(180deg, #b4edf2 0%, #d8f4f6 30%, #ecf9fb 65%, #def4f6 100%) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.95) !important;
  border-radius: 26px !important;
  box-shadow: 0 25px 60px -15px rgba(2, 99, 109, 0.28), 0 0 0 1px rgba(2, 99, 109, 0.08) !important;
  box-sizing: border-box !important;
  overscroll-behavior: contain !important;
}

/* Ambient Radial Glows */
.modal-ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

.glow-1 {
  width: 220px;
  height: 220px;
  background: #d1faff;
  top: -80px;
  right: -50px;
}

/* Close Button */
.terms-single-card .modal-close-btn {
  width: 32px !important;
  height: 32px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(2, 99, 109, 0.12) !important;
  border-radius: 50% !important;
  color: #02636d !important;
  font-size: 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  position: absolute !important;
  top: 18px !important;
  right: 18px !important;
  box-shadow: 0 2px 8px rgba(2, 99, 109, 0.08) !important;
  transition: all 0.2s ease !important;
  z-index: 10 !important;
}

.terms-single-card .modal-close-btn:hover {
  background: #ffffff !important;
  color: #01434a !important;
  transform: scale(1.08);
}

/* Header Area */
.terms-header {
  position: relative;
  z-index: 1;
  text-align: left;
  margin-bottom: 10px;
  padding-right: 36px;
}

.terms-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(2, 99, 109, 0.15);
  padding: 3px 10px 3px 6px;
  border-radius: 20px;
  margin-bottom: 6px;
  box-shadow: 0 2px 5px rgba(2, 99, 109, 0.05);
}

.terms-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.terms-brand-title {
  font-size: 11px;
  font-weight: 800;
  color: #02636d;
  margin: 0;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.terms-main-title {
  font-size: 22px;
  font-family: inherit;
  font-weight: 800;
  color: #0a3a42;
  margin: 2px 0 3px 0;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.terms-subtitle {
  font-size: 11px;
  color: #3b6b74;
  margin: 0;
  font-weight: 500;
  line-height: 1.4;
}

/* Quick Jump Pill Navigation */
.legal-tab-nav {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 6px;
  background: rgba(2, 99, 109, 0.12);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(2, 99, 109, 0.15);
  margin-bottom: 10px;
  box-sizing: border-box !important;
}

.legal-tab-btn {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  outline: none;
  padding: 7px 8px;
  font-size: 11.5px;
  font-weight: 750;
  color: #0a4f57;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  border: 1px solid transparent;
  text-transform: uppercase;
}

.tab-svg-icon {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  flex-shrink: 0;
}

.legal-tab-btn:hover {
  color: #02636d;
  background: rgba(255, 255, 255, 0.5);
}

.legal-tab-btn.active {
  background: #ffffff;
  color: #02636d;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(2, 99, 109, 0.15);
  border: 1px solid rgba(2, 98, 109, 0.3);
}

/* Unified Continuous Scroll Box */
.terms-scroll-box {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 180px;
  max-height: 290px;
  overflow-y: auto;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
  background: rgba(220, 243, 246, 0.65);
  border: 1px solid rgba(2, 99, 109, 0.2);
  box-shadow: inset 0 2px 8px rgba(2, 99, 109, 0.08);
  padding: 12px 14px 16px 14px;
  border-radius: 16px;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.55;
  color: #2b484e;
  text-align: left;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

/* Section Dividers inside Continuous View */
.legal-doc-section {
  display: flex;
  flex-direction: column;
}

.legal-section-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
  color: #024e56;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 2px solid rgba(2, 99, 109, 0.2);
}

.legal-doc-section:first-child .legal-section-divider {
  margin-top: 0;
}

/* Intro Banner Card */
.legal-intro-banner {
  background: linear-gradient(135deg, #e4f7f8 0%, #daf2f4 100%);
  border: 1px solid rgba(2, 99, 109, 0.22);
  border-left: 3.5px solid #02636d;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: #02636d;
  font-weight: 600;
}

.legal-intro-banner p {
  margin: 0;
}

/* Item Cards */
.legal-item {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8) 0%, rgba(235, 248, 250, 0.75) 100%);
  border: 1px solid rgba(45, 146, 157, 0.35);
  border-left: 2.5px solid #02636d;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 7px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  box-shadow: 0 2px 6px rgba(2, 99, 109, 0.04);
}

.legal-num {
  font-size: 10px;
  font-weight: 800;
  background: #ccfbf9;
  color: #02636d;
  border: 1px solid #99f6e4;
  padding: 2px 6px;
  border-radius: 6px;
  margin-top: 1px;
  flex-shrink: 0;
}

.legal-item h4 {
  font-size: 12px;
  font-weight: 800;
  color: #024e56;
  margin: 0 0 2px 0;
}

.legal-item p {
  margin: 0;
  font-size: 11px;
  color: #38565e;
  line-height: 1.45;
}

.legal-list {
  margin: 4px 0 0 14px;
  padding: 0;
}

.legal-list li {
  margin-bottom: 2px;
  font-size: 11px;
  color: #38565e;
}

/* Scrollbar */
.terms-scroll-box::-webkit-scrollbar {
  width: 4px;
}

.terms-scroll-box::-webkit-scrollbar-thumb {
  background: #90c6cc;
  border-radius: 4px;
}

/* Scroll Helper Hint */
.terms-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: #09616a;
  background: rgba(2, 99, 109, 0.08);
  border: 1px solid rgba(2, 99, 109, 0.12);
  border-radius: 6px;
  padding: 4px 8px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.terms-scroll-hint.unlocked {
  background: rgba(23, 153, 162, 0.15);
  color: #02636d;
  border-color: rgba(23, 153, 162, 0.35);
}

.terms-scroll-hint.shake {
  animation: hintShake 0.3s ease-in-out;
}

@keyframes hintShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Checkbox Section */
.legal-agree-container {
  position: relative !important;
  z-index: 1 !important;
  display: block !important;
  width: 100% !important;
  margin: 0 0 10px 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.legal-checkbox-label {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  width: 100% !important;
  cursor: pointer !important;
}

.legal-checkbox-label input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  accent-color: #02636d !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  margin-top: 1px !important;
}

.checkbox-text {
  font-size: 11.5px !important;
  line-height: 1.4 !important;
  color: #1f4a52 !important;
  font-weight: 600 !important;
}

.checkbox-text strong {
  color: #02636d !important;
  font-weight: 800 !important;
}

/* Proceed Button */
.proceed-btn {
  position: relative !important;
  z-index: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 220px !important;
  max-width: 300px !important;
  margin: 0 auto !important;
  padding: 10px 24px !important;
  border-radius: 50px !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.6px !important;
  transition: all 0.25s ease !important;
}

.proceed-btn:disabled {
  background: rgba(2, 99, 109, 0.14) !important;
  color: #729ca3 !important;
  border: 1px solid rgba(2, 99, 109, 0.18) !important;
  cursor: not-allowed !important;
}

.proceed-btn:not(:disabled) {
  background: linear-gradient(135deg, #1898a0 0%, #086068 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 6px 18px rgba(2, 99, 109, 0.28) !important;
  cursor: pointer !important;
}

/* ==========================================
   MOBILE VIEWPORT REFINEMENTS (BOTTOM SHEET)
   ========================================== */
@media (max-width: 768px) {
  .terms-single-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 18px 16px max(24px, calc(16px + env(safe-area-inset-bottom, 16px))) 16px !important;
    border-radius: 24px 24px 0 0 !important;
    background: #ffffff !important;
    border: none !important;
    border-top: 2px solid rgba(67, 155, 146, 0.95) !important;
    box-shadow: 0 -12px 40px rgba(2, 99, 109, 0.25) !important;
    max-height: 90dvh !important;
  }

  /* Completely removed fake drag handle ::before */
  .terms-single-card::before {
    display: none !important;
  }

  .terms-main-title {
    font-size: 19px !important;
  }

  .terms-scroll-box {
    max-height: 240px !important;
    padding: 10px 10px 14px 10px !important;
  }
}