/* apps/pricing/static/pricing/css/calculator.css */
/* ============================================================================
   PRICING / CALCULATOR.CSS (v4.1 — two-card layout, improved HCM & Upload)
   ========================================================================== */

:root {
  --pxq-font-size: 14px;
  --pxq-line: 1.20;
}

.pxq-muted { color: var(--color-text-dim); }

.pxq-calculator.pxq-v4 {
  display: grid;
  gap: 14px;
  font-size: var(--pxq-font-size);
  line-height: var(--pxq-line);
}

/* Header */
.pxq-header { padding: 10px; display: flex; align-items: flex-start; gap: 12px; }
.pxq-header-main { flex: 1 1 auto; }
.pxq-h1 { margin: 0; font-size: clamp(20px, 3vw, 26px); color: var(--color-primary); font-weight: 800; letter-spacing: .2px; }
.pxq-sub { margin: 4px 0 0 0; color: var(--color-text-dim); font-size: 14px; }
.pxq-step { align-self: center; color: var(--color-secondary); font-weight: 700; }

/* Split layout */
.pxq-split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 14px; align-items: stretch; }
@media (max-width: 1040px) { .pxq-split { grid-template-columns: 1fr; } }

.pxq-left.card,
.pxq-right.card {
  display: flex;
  flex-direction: column;
  padding: 16px;
}

/* Section headings */
.pxq-h2 { margin: 2px 0 10px 0; font-size: 18px; color: var(--color-secondary); font-weight: 800; }

/* Forms & Inputs */
.pxq-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 1040px) { .pxq-form-grid { grid-template-columns: 1fr; } }

.pxq-field { display: grid; gap: 6px; }
.pxq-label { font-weight: 700; color: var(--color-secondary); }

.pxq-input, .pxq-select {
  width: 100%; height: 44px; border-radius: 12px; border: 1px solid #e2e8f0;
  padding: 10px 12px; background: #fff; font: inherit; color: var(--color-text);
}
.pxq-input:focus, .pxq-select:focus { outline: none; box-shadow: 0 0 0 3px #e6ecfa; border-color: #c9d7f6; }

.pxq-radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.pxq-radio { display: inline-flex; align-items: center; gap: 8px; color: var(--color-secondary); }

/* Common card actions (footer CTA separate) */
.pxq-card-actions {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #eceff6;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Upload: Combined drop + preview in single fixed-height area */
.pxq-dropzone {
  position: relative;
  border: 2px dashed #cfd7e8;
  background: #fbfcff;
  border-radius: 16px;

  /* Fixed but responsive height */
  height: clamp(260px, 38vh, 380px);

  overflow: hidden;                 /* do not exceed card area */
  display: grid;
  place-items: center;
  padding: 16px;
  outline: none;
}
.pxq-dropzone:focus-visible { box-shadow: 0 0 0 3px #e6ecfa; }
.pxq-dropzone.pxq-dragover { border-color: var(--color-primary); background: #f5f7ff; }

/* Idle inner (centered “Upload Preview” with icon) */
.pxq-dropzone-inner { text-align: center; display: grid; place-items: center; gap: 8px; }
.pxq-drop-icon { width: 44px; height: 44px; opacity: 0.75; }
.pxq-drop-title { font-weight: 800; color: var(--color-secondary); font-size: 16px; }
.pxq-drop-sub { margin-top: 2px; color: var(--color-text-dim); font-size: 13px; }
.pxq-browse-btn { border: 1px solid #dbe3f2; background: #fff; padding: 6px 10px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.pxq-browse-btn:hover { background: #f5f8ff; }

/* Preview image fills safely inside card */
/* Center the preview image inside the dropzone */
#previewImg {
  max-width: 100%;
  max-height: 100%;
  width: auto;            /* prevent forced stretching */
  height: auto;           /* keep aspect ratio */
  margin: auto;           /* center in grid cell */
  display: block;
  object-fit: contain;    /* scale without cropping */
  object-position: center;/* ensure true centering */
}

/* Prevent broken icon when no src */
#previewImg[hidden],
#previewImg:not([src]) {
  display: none !important;
}


/* When preview is visible, make the area feel full-bleed */
.pxq-dropzone.has-image {
  padding: 6px;                     /* tighter padding for larger visual */
  border-style: solid;              /* looks nicer than dashed on preview */
}
.pxq-dropzone.has-image .pxq-dropzone-inner { display: none; }

/* Small Remove button (always visible; disabled when no image) */
.pxq-remove {
  position: absolute;
  top: 10px; right: 10px;
  border: 1px solid #e8ebf4;
  background: #fff;
  padding: 6px 8px;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  z-index: 2;
  font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.pxq-remove svg { width: 14px; height: 14px; }
.pxq-remove:hover { background: #f5f7fc; }
.pxq-remove[disabled],
.pxq-remove[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* SR-only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ===========================
   Custom Select (HCM System)
   =========================== */
.pxq-select-wrap { position: relative; }

.pxq-select-trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 44px; padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--color-text);
  font: inherit; font-weight: 600;
  cursor: pointer;
  transition: box-shadow 160ms var(--transition-fast), border-color 160ms var(--transition-fast);
}
.pxq-select-trigger:hover { border-color: #d6deeb; }
.pxq-select-trigger:focus-visible { outline: none; box-shadow: 0 0 0 3px #e6ecfa; border-color: #c9d7f6; }

.pxq-select-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pxq-select-caret { width: 18px; height: 18px; color: var(--color-secondary); flex: 0 0 auto; transition: transform 160ms var(--transition-fast); }
.pxq-select-trigger[aria-expanded="true"] .pxq-select-caret { transform: rotate(180deg); }

.pxq-select-menu {
  position: absolute;
  left: 0; right: 0;
  margin-top: 8px;           /* space between button and dropdown */
  background: #fff;
  border: 1px solid #e6eaf4;
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  padding: 6px;
  list-style: none;
  max-height: 260px;
  overflow: auto;
  z-index: 40;
}

.pxq-option {
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--color-secondary);
  cursor: pointer;
  user-select: none;
}
.pxq-option:hover,
.pxq-option[aria-selected="true"] {
  background: #eef2ff;
  color: var(--color-primary);
}

/* Footer CTA card */
.pxq-footer.card {
  padding: 12px 16px;
  display: flex;
  justify-content: flex-end;
}


/* ===== Modal for extraction ===== */
.pxq-modal[hidden] { display: none !important; }

.pxq-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45); /* slate-900/45 */
  display: grid;
  place-items: center;
  z-index: 9999;
}

.pxq-modal-inner {
  background: #fff;
  border-radius: 14px;
  padding: 20px 24px;
  min-width: 280px;
  max-width: 90vw;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.25);
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
}

.pxq-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #e5e7eb;
  border-top-color: var(--color-primary, #4f46e5);
  animation: pxq-spin 1s linear infinite;
}

@keyframes pxq-spin {
  to { transform: rotate(360deg); }
}

.pxq-modal-text {
  font-weight: 800;
  color: var(--color-secondary);
  font-size: 16px;
}

.pxq-modal-sub {
  font-size: 13px;
  color: var(--color-text-dim);
}


#pxqCalculator {
  transform: scale(1.0);
  transform-origin: top center;
}


.pxq-error {
  margin-top: 6px;
  font-size: 12px;
  color: #d44;
}

.pxq-invalid {
  outline: 2px solid #d44;
  outline-offset: 2px;
}

.pxq-field[hidden] { display: none !important; }

/* Two blocks inside the left card (desktop), stacked on mobile */
.pxq-form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.pxq-form-col {
  display: grid;
}

@media (max-width: 1040px) {
  .pxq-form-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Gaps for various form layouts */
.pxq-form-grid-2col {
  gap: 28px;
}

.pxq-form-col {
  gap: 20px;
}

.pxq-field {
  gap: 6px;
}
