/* ========================================
   SendPilot Consolidated CSS
   ========================================
   This file consolidates all CSS from:
   - layout_styles.css
   - get_started_styles.css  
   - Inline styles from all pages
   - Modal and component styles
   
   Organized by category for maintainability
   ======================================== */

/* ========================================
   1. CSS VARIABLES & ROOT
   ======================================== */
:root {
  --bg1: #0b1220;
  --bg2: #10192d;
  --brand: #5ad2ff;
  --accent: #7affc8;
  --text: #e9f1ff;
  --muted: #a2b3d3;
  --card: rgba(255,255,255,0.06);
  --card-stroke: rgba(255,255,255,0.12);
  --glow: 0 0 40px rgba(90,210,255,.45);
  --success: #3ec99c;
  --warn: #ffd166;
  --danger: #ff7a7a;
  --error: #ff7a7a;
  color-scheme: dark;
}

/* ========================================
   2. BASE STYLES & RESET
   ======================================== */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 20% 10%, #13203a 0%, transparent 55%),
    radial-gradient(800px 800px at 80% 50%, #0e1f3a 0%, transparent 50%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: var(--bg2);
  overflow-x: hidden;
}

/* ========================================
   3. TYPOGRAPHY & LINKS
   ======================================== */
a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1 {
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.05;
  margin: 8px 0;
}

.lead {
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 20px);
  max-width: 60ch;
}

/* ========================================
   4. LAYOUT CONTAINERS
   ======================================== */
.wrap {
  max-width: 1200px;
  margin: 24px auto 48px;
  padding: 0 20px;
}

.card {
  border: 1px solid var(--card-stroke);
  background: rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 16px;
}

/* Hero card enhancements */
.card.hero {
  position: relative;
  width: min(980px, 92vw);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  backdrop-filter: blur(14px);
  border-radius: 24px;
  padding: clamp(24px, 4vw, 48px);
  box-shadow: var(--glow);
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
}

.card.hero::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: conic-gradient(from 0deg, rgba(90,210,255,.0), rgba(90,210,255,.25), rgba(122,255,200,.2), rgba(90,210,255,.0));
  filter: blur(18px);
  z-index: -1;
}

/* ========================================
   5. NAVIGATION & HEADER
   ======================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(15,25,45,.75), rgba(15,25,45,.45));
  border-bottom: 1px solid var(--card-stroke);
}

.navInner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
  letter-spacing: .02em;
}

.plane {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 4px 16px rgba(90,210,255,.45));
  animation: bob 4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}

/* ========================================
   6. STARFIELD ANIMATION
   ======================================== */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .25;
}

.stars span {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  filter: drop-shadow(0 0 6px #9bdcff);
  opacity: .7;
  animation: float 14s linear infinite;
}

@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(-100vh); }
}

/* ========================================
   7. BUTTONS
   ======================================== */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .02em;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-lg {
  font-size: 16px;
  padding: 14px 18px;
  border-radius: 14px;
}

.btn-xl {
  font-size: 18px;
  padding: 16px 22px;
  border-radius: 16px;
}

.btnPrimary {
  background: linear-gradient(180deg, var(--brand), #45a0d1);
  color: #082030;
  box-shadow: 0 8px 24px rgba(90,210,255,.4), inset 0 -3px 0 rgba(0,0,0,.2);
}

.btnPrimary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(90,210,255,.55), inset 0 -3px 0 rgba(0,0,0,.25);
}

.btnGhost {
  background: transparent;
  border: 1px solid var(--card-stroke);
  color: var(--text);
}

.btnGhost:hover {
  background: rgba(255,255,255,.06);
}

.btnWarn {
  background: rgba(255, 209, 102, 0.15);
  border: 1px solid rgba(255, 209, 102, 0.35);
  color: #ffd166;
}

.btnWarn:hover {
  background: rgba(255, 209, 102, 0.25);
  color: #ffe6b5;
}

.btnDanger {
  background: rgba(255, 122, 122, 0.15);
  border: 1px solid rgba(255, 122, 122, 0.35);
  color: #ff7a7a;
}

.btnDanger:hover {
  background: rgba(255, 122, 122, 0.25);
  color: #ffd0d0;
}

.btnSuccess {
  background-color: #28a745;
  color: #fff;
  font-weight: 600;
}

.btnSuccess:hover {
  background-color: #218838;
}

.btnWarning {
  background-color: #ff9800;
  color: #fff;
  font-weight: 600;
}

.btnWarning:hover {
  background-color: #e68900;
}

.btnQueue {
  font-size: 12px;
  padding: 4px 8px;
  line-height: 1.2;
  border-radius: 8px;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(80%);
}

.btnIcon {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--card-stroke);
  background: rgba(255,255,255,.06);
  font-size: 18px;
  line-height: 1;
}

.btnIcon:hover {
  background: rgba(255,255,255,.1);
}

.btnEdit {
  color: #9bdcff;
}

.btnEdit:hover {
  box-shadow: 0 0 0 3px rgba(90,210,255,.2);
}

/* Translucent buttons */
.btnTranslucent-green {
  background: rgba(40, 167, 69, 0.15);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.4);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btnTranslucent-green:hover {
  background: rgba(40, 167, 69, 0.25);
  transform: translateY(-1px);
}

.btnTranslucent-orange {
  background: rgba(255, 159, 64, 0.15);
  color: #ff9f40;
  border: 1px solid rgba(255, 159, 64, 0.4);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btnTranslucent-orange:hover {
  background: rgba(255, 159, 64, 0.25);
  transform: translateY(-1px);
}

.btnTranslucent-blue {
  background: rgba(0, 123, 255, 0.15);
  color: #007bff;
  border: 1px solid rgba(0, 123, 255, 0.4);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btnTranslucent-blue:hover {
  background: rgba(0, 123, 255, 0.25);
  transform: translateY(-1px);
}

/* ========================================
   8. BADGES
   ======================================== */
.badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--card-stroke);
  display: inline-block;
}

.badge.live {
  background: rgba(122,255,200,.12);
  color: #baffea;
}

.badge.scheduled {
  background: rgba(90,210,255,.12);
  color: #aee8ff;
}

.badge.draft {
  background: rgba(255,255,255,.06);
  color: #cfe0ff;
}

.badge.failed {
  background: rgba(255,122,122,.12);
  color: #ffd0d0;
}

.badge.pending {
  background: rgba(255,209,102,.12);
  color: #ffe6b5;
}

.badge.sent {
  background: rgba(62,201,156,.15);
  color: #baffea;
}

.badge.archived {
  background: rgba(255,255,255,.06);
  color: #cfe0ff;
}

.badge.bounced {
  background: rgba(255, 166, 0, .15);
  color: #ffd27f;
}

.badge.canceled {
  background: rgba(160, 160, 160, .15);
  color: #cccccc;
}

.badge.active {
  background: rgba(62, 201, 156, .15);
  color: #9fffd6;
}

.badge.unsubscribed {
  background: rgba(180, 0, 0, .20);
  color: #ff9c9c;
}

/* Category badges */
.badge-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  text-transform: lowercase;
  user-select: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

.badge-cat:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(0,0,0,.15) inset;
}

.badge-cat.lead {
  background: rgba(122,255,200,.10);
  border-color: rgba(122,255,200,.35);
  color: #a9ffd9;
}

.badge-cat.reply {
  background: rgba(255,208,122,.10);
  border-color: rgba(255,208,122,.35);
  color: #ffe2a9;
}

.badge-cat.info {
  background: rgba(90,210,255,.10);
  border-color: rgba(90,210,255,.35);
  color: #bfeaff;
}

.badge-cat.spam {
  background: rgba(255,139,139,.10);
  border-color: rgba(255,139,139,.35);
  color: #ffc7c7;
}

.badge-cat.system {
  background: rgba(180,180,255,.10);
  border-color: rgba(180,180,255,.35);
  color: #d8d8ff;
}

.badge-cat.bounce {
  background: rgba(255,139,139,.10);
  border-color: rgba(255,139,139,.35);
  color: #ffc7c7;
}

/* ========================================
   9. FORMS & INPUTS
   ======================================== */
label {
  font-weight: 600;
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--card-stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  outline: none;
}

input::placeholder, textarea::placeholder {
  color: #c8d6f0;
  opacity: .6;
}

.help {
  color: var(--muted);
  font-size: 12px;
}

/* Dark select theme */
.selectDark, select.selectDark {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--card-stroke);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.2;
}

.selectDark:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(90,210,255,.25);
}

.selectDark option {
  background-color: #1a2336;
  color: #e9f1ff;
}

.selectDark option:checked {
  background-color: #2b3954;
  color: #fff;
}

.selectDark option:hover {
  background-color: #334466;
  color: #fff;
}

/* Form layouts */
.fields {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(12, 1fr);
}

.field {
  grid-column: span 12;
  display: grid;
  gap: 6px;
}

.two {
  grid-column: span 6;
}

.three {
  grid-column: span 4;
}

@media (max-width: 800px) {
  .two, .three {
    grid-column: 1/-1;
  }
}

/* Form check inline */
.form-check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.form-check-inline input {
  margin: 0;
  flex: 0 0 auto;
}

.form-check-inline label {
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
}

@media (min-width: 560px) {
  .form-check-inline {
    flex-wrap: nowrap;
  }
}

/* ========================================
   10. TABLES
   ======================================== */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--card-stroke);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

tr:hover td {
  background: rgba(255,255,255,.03);
}

tbody tr:nth-child(odd) {
  background: rgba(255,255,255,.02);
}

.text-end {
  text-align: right;
}

td.trunc {
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Actions column */
.actionsCell {
  white-space: nowrap;
  width: 1%;
  padding: 4px 6px;
}

th.actionsCell, td.actionsCell {
  width: 120px;
}

.actionsInline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

/* ========================================
   11. PAGINATION
   ======================================== */
.pager {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.pager a, .pager button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--card-stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  text-decoration: none;
}

.pager a:hover, .pager button:hover {
  background: rgba(255,255,255,.10);
}

/* ========================================
   12. KPI CARDS (DASHBOARD)
   ======================================== */
.kpiRow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

@media (max-width: 980px) {
  .kpiRow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kpiCard {
  border: 1px solid var(--card-stroke);
  background: rgba(255,255,255,.07);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--glow);
}

.kpiLabel {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.kpiValue {
  font-weight: 800;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: .02em;
}

/* ========================================
   13. ACTION BOXES
   ======================================== */
.actionBoxes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.actionBox {
  border: 1px solid var(--card-stroke);
  background: rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 12px 14px;
}

/* Page actions */
.page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 0 0 16px 0;
}

/* ========================================
   14. TOOLTIPS
   ======================================== */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,25,45,.95);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: pre-line;
  z-index: 20;
  width: max-content;
  max-width: 240px;
  text-align: center;
}

.tooltip:hover::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(15,25,45,.95);
}

/* Click-activated tooltip */
.noteView.tooltip.active::after,
.noteView.tooltip.active::before {
  display: block;
}

.noteView.tooltip::after,
.noteView.tooltip::before {
  display: none;
}

/* ========================================
   15. MODALS
   ======================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8,16,28,.6);
  backdrop-filter: blur(2px);
  z-index: 900;
  display: none;
}

.modal-backdrop.show {
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.show {
  display: flex;
}

.modal-dialog {
  width: min(1100px, 96vw);
  height: 92vh;
  display: flex;
}

.modal-dialog.modal-sm {
  max-width: 420px;
  height: auto !important;
}

.modal-dialog.modal-xl {
  width: min(1200px, 96vw);
}

.modal-dialog-scrollable {
  overflow: visible !important;
}

.modal-content {
  background: rgba(18,28,46,.98);
  border: 1px solid var(--card-stroke);
  border-radius: 18px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
}

.modal-header, .modal-footer {
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-stroke);
}

.modal-footer {
  border-top: 1px solid var(--card-stroke);
  border-bottom: 0;
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(18,28,46,.85), rgba(18,28,46,.98));
  backdrop-filter: blur(3px);
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px !important;
  overscroll-behavior: contain;
}

/* Modal forms */
.modal form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* Specific modal overrides */
#deleteRecipientModal .modal-dialog {
  height: auto !important;
  max-width: 420px;
}

#deleteRecipientModal .modal-content {
  flex: initial;
}

#deleteRecipientModal .modal-body {
  overflow: visible;
}

#tplDeleteModal .modal-dialog {
  height: auto !important;
  max-height: none !important;
}

#tplDeleteModal .modal-content {
  max-height: none !important;
}

#tplDeleteModal form {
  display: block !important;
  min-height: 0 !important;
}

#tplDeleteModal .modal-body {
  overflow: visible !important;
  padding: 16px;
}

#tplDeleteModal .modal-footer {
  position: static !important;
  background: transparent;
  backdrop-filter: none;
}

#tplDeleteModal .modal-dialog.modal-sm {
  max-width: 420px;
}

/* ========================================
   16. CAMPAIGN STEPS & PILLS
   ======================================== */
.pillbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  appearance: none;
  border: 1px solid var(--card-stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.pill.on {
  border-color: rgba(122,255,200,.5);
  box-shadow: 0 0 0 3px rgba(122,255,200,.15) inset;
}

.pill.off {
  opacity: .55;
}

.pill-cta.on {
  border-color: rgba(90,210,255,.55);
  box-shadow: 0 0 0 3px rgba(90,210,255,.18) inset;
}

/* Campaign step rows */
.ai-step-row, .rec-step-row, .qm-step-row {
  display: grid;
  grid-template-columns: 1.6fr .7fr 1fr auto;
  gap: 8px;
  align-items: end;
}

.ai-step-row .step-remove,
.rec-step-row .step-remove,
.qm-step-row .step-remove {
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1;
}

/* AI queue box */
.ai-queue-box {
  display: none;
  border: 1px solid var(--card-stroke);
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: 12px;
  max-height: 40vh;
  overflow: auto;
}

.ai-queue-box.is-open {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#aiCampSteps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 40vh !important;
  overflow: auto !important;
}

/* Step actions */
.step-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ========================================
   17. FEATURE STAGE (INTRO)
   ======================================== */
.featureStage {
  position: relative;
  margin: 28px 0 20px;
  min-height: 40px;
}

.feature {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(18px, 2.4vw, 22px);
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-stroke);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(10px) scale(.98);
  will-change: transform, opacity;
  filter: drop-shadow(0 0 10px rgba(90,210,255,.25));
}

.feature.show {
  animation: fadeIn 700ms cubic-bezier(.2,.8,.2,1) forwards;
}

.feature.hide {
  animation: fadeOut 500ms ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-6px) scale(.99); }
}

/* ========================================
   18. STEPPER (GET STARTED)
   ======================================== */
.stepper {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 22px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.15);
  border: 1px solid var(--card-stroke);
}

.dot.active {
  background: linear-gradient(180deg, var(--brand), #45a0d1);
  box-shadow: 0 0 0 3px rgba(90,210,255,.18);
}

.dot.done {
  background: linear-gradient(180deg, var(--accent), #3ec99c);
  box-shadow: 0 0 0 3px rgba(122,255,200,.18);
}

.step {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  height: 0;
  overflow: hidden;
  transition: opacity .3s, transform .3s;
}

.step.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  height: auto;
}

/* ========================================
   19. FOOTER
   ======================================== */
.footer {
  margin: 0 auto 0;
  max-width: 1200px;
  color: var(--muted);
  font-size: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--card-stroke);
  width: 100%;
}

.footerInner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer .devBy {
  font-style: italic;
}

/* ========================================
   20. UTILITY CLASSES
   ======================================== */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.hide {
  display: none !important;
}

.text-muted {
  color: var(--muted);
}

/* ========================================
   21. RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 980px) {
  .kpiRow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .two, .three {
    grid-column: 1/-1;
  }
}

@media (min-width: 560px) {
  .form-check-inline {
    flex-wrap: nowrap;
  }
}

/* ========================================
   22. ACCESSIBILITY & MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .plane {
    animation: none !important;
  }
  
  .stars {
    display: none;
  }
  
  .feature.show, .feature.hide {
    animation: none !important;
  }
  
  .modal-backdrop {
    backdrop-filter: none;
  }
}

/* ========================================
   23. INSTALLER SPECIFIC STYLES
   ======================================== */
.installer-wrap {
  max-width: 820px;
  margin: 28px auto;
  padding: 0 16px;
}

.installer-card {
  border: 1px solid var(--card-stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border-radius: 20px;
  padding: 20px;
}

.installer-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.installer-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-stroke);
  cursor: pointer;
}

.installer-btn.primary {
  background: linear-gradient(180deg, #5ad2ff, #45a0d1);
  color: #082030;
  font-weight: 800;
}

.installer-btn.ghost {
  background: transparent;
  color: var(--text);
}

.installer-step {
  display: none;
}

.installer-step.show {
  display: block;
}

.installer-ok {
  color: #7affc8;
}

.installer-err {
  color: #ff7a7a;
}

/* ========================================
   24. MODAL MASK (LEGACY SUPPORT)
   ======================================== */
.modalMask {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0,0,0,.6);
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(3px);
}

.modalMask.show {
  display: flex;
}

.modalMask .modal {
  width: min(520px, 92vw);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  border: 1px solid var(--card-stroke);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--glow);
}

.modalMask .modal h3 {
  margin: 6px 0;
}

.modalMask .modal p {
  color: var(--muted);
}

/* ========================================
   25. CONFETTI & SPECIAL EFFECTS
   ======================================== */
#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  display: none;
}

/* ========================================
   26. CTA ROW
   ======================================== */
.ctaRow {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 26px;
}

/* ========================================
   27. ERROR STATES
   ======================================== */
.err {
  color: var(--error);
  font-size: 12px;
  display: none;
}

.err.show {
  display: block;
}

/* ========================================
   28. ACTIONS & BUTTONS LAYOUT
   ======================================== */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* ========================================
   29. FINAL OVERRIDES & FIXES
   ======================================== */
/* Ensure all modal elements have proper overflow handling */
.modal,
.modal-dialog,
.modal-content,
.modal-body,
.ai-queue-box,
#aiCampSteps {
  min-height: 0 !important;
  max-height: none !important;
}

.modal-dialog {
  height: 92vh !important;
  display: flex !important;
}

.modal-content {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  overflow: visible !important;
}

.modal-body {
  flex: 1 1 auto !important;
  overflow: auto !important;
  padding: 16px !important;
}

/* Make modal-content a flex column for AI Bulk Modal */
#aiBulkModal .modal-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#aiBulkModal #aiBulkForm {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

#aiBulkModal .modal-body {
  flex: 1 1 0%;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  overscroll-behavior: contain;
}

#aiBulkModal .modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
}

#aiAddCampStep {
  display: inline-flex;
  width: auto;
  align-self: flex-end;
  margin-top: 8px;
}

/* AI Bulk visibility overrides */
#aiBulkModal #aiQueueOptions {
  display: none;
}

#aiBulkModal #aiCampaignWrap {
  display: none !important;
}

#aiBulkModal #aiCampaignWrap.is-open {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
}

#aiBulkModal #aiAddCampStep {
  display: inline-flex;
  width: auto;
  align-self: flex-end;
  margin-top: 8px;
}

/* Queue options visibility */
#aiQueueOptions {
  display: none;
}

#aiQueueOptions.is-open {
  display: block !important;
}

#aiCampaignWrap {
  display: none;
}

#aiCampaignWrap.is-open {
  display: block !important;
}

/* Ensure forms inside modals flex properly */
.modal form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* Make the queue form flex so the body can scroll */
#queueModal form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* Right-aligned, compact Add step button */
#qmCampaign .card {
  display: flex;
  flex-direction: column;
}

#qmAddStep {
  align-self: flex-end;
  width: auto;
  margin-top: 8px;
}

/* Campaign step row layout */
#qmSteps .qm-step-row {
  display: grid;
  grid-template-columns: 1.6fr .7fr 1fr auto;
  gap: 8px;
  align-items: end;
}

#qmSteps .qm-step-row .step-remove {
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1;
}

/* Compact, right-aligned Add Step button */
#campaignOptions .card {
  display: flex;
  flex-direction: column;
}

#addCampStep {
  align-self: flex-end;
  margin-top: 8px;
  width: auto;
}

/* Nicer step row grid */
#campSteps .rec-step-row {
  display: grid;
  grid-template-columns: 1.6fr .7fr 1fr auto;
  gap: 8px;
  align-items: end;
}

#campSteps .rec-step-row .step-remove {
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1;
}

/* Make the form flex so .modal-body can scroll */
#addRecipientModal form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* Compact, right-aligned Add Step button */
#campaignOptions .card {
  display: flex;
  flex-direction: column;
}

#addCampStep {
  align-self: flex-end;
  margin-top: 8px;
  width: auto;
}

/* Nicer step row grid */
#campSteps .rec-step-row {
  display: grid;
  grid-template-columns: 1.6fr .7fr 1fr auto;
  gap: 8px;
  align-items: end;
}

#campSteps .rec-step-row .step-remove {
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1;
}

/* Make the form flex so .modal-body can scroll */
#addRecipientModal form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* Make the Manage Profile modal compact */
#configModal .modal-dialog {
  width: min(420px, 94vw);
  height: auto !important;
  max-height: none !important;
  display: block !important;
}

#configModal .modal-content {
  max-height: none !important;
}

#configModal form {
  display: block !important;
  min-height: 0 !important;
}

#configModal .modal-body {
  overflow: visible !important;
  padding: 14px !important;
}

/* In case some global container is clipping everything */
.modal * {
  overflow: visible;
}

/* ========================================
   30. INDEX.PHP SPECIFIC STYLES
   ======================================== */
/* CSS Variables for index.php */
:root {
  --footerBg1: rgba(255,255,255,.04);
  --footerBg2: rgba(255,255,255,.02);
}
/* Site footer styles */
.siteFooter {
  margin-top: 40px;
  border-top: 1px solid var(--card-stroke);
  background: linear-gradient(180deg, var(--footerBg1), var(--footerBg2));
  color: var(--muted);
  font-size: 14px;
}

.siteFooter .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.siteFooter .links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.siteFooter a {
  color: #cfe2ff;
  text-decoration: none;
}

.siteFooter a:hover {
  text-decoration: underline;
}

.siteFooter .sep {
  opacity: .4;
}

/* Social media icons */
.socialIcons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.socialIcons .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--card-stroke);
  background: rgba(255,255,255,.04);
  color: #cfe2ff;
  text-decoration: none;
}

.socialIcons .icon:hover {
  background: rgba(255,255,255,.08);
}

.socialIcons svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ========================================
   31. LEARN_MORE.PHP SPECIFIC STYLES
   ======================================== */
/* Hero section */
.hero {
  max-width: 1120px;
  margin: 32px auto 0;
  padding: 0 20px 24px;
}

.heroCard {
  position: relative;
  border: 1px solid var(--card-stroke);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  border-radius: 24px;
  padding: clamp(20px, 3.6vw, 48px);
  box-shadow: var(--glow);
}

/* Grid layout */
.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(12, 1fr);
  margin-top: 24px;
}

.col-5 {
  grid-column: span 5;
}

.col-7 {
  grid-column: span 7;
}

@media (max-width: 900px) {
  .col-5, .col-7 {
    grid-column: 1 / -1;
  }
}

/* Section styling */
.section {
  max-width: 1120px;
  margin: 26px auto;
  padding: 0 20px;
}

/* Kicker styling */
.kicker {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(122,255,200,.12);
  border: 1px solid rgba(122,255,200,.35);
  color: #baffea;
  font-size: 12px;
  letter-spacing: .02em;
}

/* Feature list */
.featureList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}

@media (max-width: 720px) {
  .featureList {
    grid-template-columns: 1fr;
  }
}

.featureItem {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--card-stroke);
  background: rgba(255,255,255,0.05);
}

.featureItem svg {
  flex: none;
}

.featureItem span {
  color: var(--muted);
}

/* How it works steps */
.howSteps {
  counter-reset: step;
  display: grid;
  gap: 12px;
}

.howItem {
  position: relative;
  padding: 14px 14px 14px 48px;
  border: 1px solid var(--card-stroke);
  background: rgba(255,255,255,0.05);
  border-radius: 14px;
}

.howItem::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #082030;
  background: linear-gradient(180deg, var(--brand), #45a0d1);
  box-shadow: 0 4px 12px rgba(90,210,255,.4);
}

/* Animation for tick icons */
.tick {
  animation: pop .45s ease both;
  transform-origin: center;
}

@keyframes pop {
  from {
    transform: scale(.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Footer for learn_more */
.footer {
  margin: 30px auto 40px;
  max-width: 1120px;
  color: var(--muted);
  font-size: 12px;
  padding: 0 20px;
}

/* ========================================
   ABOUT PAGE STYLES
   ======================================== */

/* Typography fixes */
h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px 0;
  line-height: 1.2;
}

.muted {
  color: var(--muted);
}

/* Grid system fixes */
.col-6 {
  grid-column: span 6;
}

@media (max-width: 900px) {
  .col-6 {
    grid-column: 1 / -1;
  }
}

/* Button container fixes */
.btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .btns {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .btns .btn {
    width: 100%;
    text-align: center;
  }
}

/* Values section */
.values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.value {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--card-stroke);
  border-radius: 8px;
  line-height: 1.5;
}

.value strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.value .muted {
  color: var(--muted);
  font-size: 14px;
}

/* Team section */
.team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 32px;
  margin-top: 24px;
}

.person {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--card-stroke);
  border-radius: 16px;
  line-height: 1.6;
}

.person h4 {
  margin: 12px 0 8px 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
}

.person p {
  margin: 8px 0;
}

.person ul {
  margin: 16px 0;
  padding-left: 20px;
}

.person li {
  margin: 8px 0;
}

.person .social {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.person .social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--card);
  border: 1px solid var(--card-stroke);
  border-radius: 8px;
  color: var(--muted);
  transition: all 0.2s ease;
}

.person .social a:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: rgba(90, 210, 255, 0.1);
}

.person .social svg {
  width: 20px;
  height: 20px;
}

/* Key-value table */
.kvtbl {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.kvtbl th {
  text-align: left;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--card-stroke);
  border-right: none;
  font-weight: 600;
  color: var(--text);
  width: 140px;
  font-size: 14px;
}

.kvtbl td {
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--card-stroke);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.kvtbl tr:first-child th {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.kvtbl tr:last-child th {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.kvtbl tr:first-child td {
  border-top-right-radius: 8px;
}

.kvtbl tr:last-child td {
  border-bottom-right-radius: 8px;
}

/* Pill with icon */
.pill .icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: middle;
}

/* Contact section fixes */
.contact-section p {
  margin: 12px 0;
  line-height: 1.6;
}

.contact-section a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.contact-section a:hover {
  text-decoration: underline;
  color: var(--accent);
}

.contact-section strong {
  color: var(--text);
  font-weight: 600;
}

/* Fix pricing button styling */
.contact-section .btnPrimary {
  background: linear-gradient(180deg, var(--brand), #45a0d1);
  color: #082030 !important;
  box-shadow: 0 8px 24px rgba(90,210,255,.4), inset 0 -3px 0 rgba(0,0,0,.2);
}

.contact-section .btnPrimary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(90,210,255,.55), inset 0 -3px 0 rgba(0,0,0,.25);
  color: #082030 !important;
}

/* ========================================
   END OF CONSOLIDATED CSS
   ======================================== */
