@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* Plumbing Estimator Pro — Frontend Styles */
.pe-wrap {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;  
  margin: 0 auto;
  padding: 16px;
  --pe-brand: #0057FF;
  --pe-dark: #0A0F1E;
  --pe-mid: #2A3147;
  --pe-grey: #6B7290;
  --pe-light: #F4F6FC;
  --pe-white: #FFFFFF;
  --pe-green: #00C46A;
  --pe-radius: 16px;
}

.pe-card {
  background: var(--pe-white);
  border-radius: 24px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.10);
  overflow: hidden;
}

/* Header */
.pe-header {
  background: linear-gradient(135deg, #0A0F1E, #1A2444);
  padding: 10px 40px;
  text-align: center;
}
.pe-header-icon { font-size: 36px; margin-bottom: 8px; }
.pe-header-title { color: #fff; font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.pe-header-sub   { color: rgba(255,255,255,0.55); font-size: 14px; margin: 0; }

/* Progress */
.pe-progress-wrap { padding: 24px 40px 0; background:#34B9FB4A; }
.pe-progress-top  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pe-step-label    { font-size: 13px; color: var(--pe-grey); }
.pe-step-pct      { font-size: 13px; font-weight: 600; color: var(--pe-brand); }
.pe-progress-bar  { height: 6px; background: var(--pe-light); border-radius: 99px; overflow: hidden; }
.pe-progress-fill { height: 100%; background: linear-gradient(90deg, var(--pe-brand), #4D8EFF); border-radius: 99px; transition: width 0.4s cubic-bezier(0.4,0,0.2,1); }

/* Body */
.pe-body { padding: 28px 40px 40px; background: #34B9FB4A; }

/* Step */
.pe-step { display: none; animation: pe-in 0.3s ease; }
.pe-step.pe-active { display: block; }
@keyframes pe-in { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

.pe-question { font-size: 20px; font-weight: 700; color: var(--pe-dark); margin: 0 0 6px; line-height: 1.3; }
.pe-hint     { font-size: 14px; color: var(--pe-grey); margin: 0 0 24px; }

/* Options grid */
.pe-options       { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pe-options.cols1 { grid-template-columns: 1fr; }

.pe-opt {
  background: var(--pe-light);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--pe-dark);
  cursor: pointer;
  transition: all 0.18s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.3;
  font-family: inherit;
}
.pe-opt:hover    { border-color: var(--pe-brand); background: #E8F0FF; color: #000;}
.pe-opt.selected { border-color: var(--pe-brand); background: #E8F0FF; color: var(--pe-brand); }
.pe-opt-icon     { font-size: 20px; flex-shrink: 0; }

/* Photo upload */
.pe-upload-zone {
  border: 2px dashed #CBD5E8;
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.pe-upload-zone:hover    { border-color: var(--pe-brand); background: #E8F0FF; }
.pe-upload-input         { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.pe-upload-icon          { font-size: 36px; margin-bottom: 10px; }
.pe-upload-zone p        { font-size: 15px; color: var(--pe-grey); margin: 0 0 4px; }
.pe-upload-zone span     { font-size: 13px; color: var(--pe-brand); font-weight: 500; }
.pe-upload-preview       { margin-top: 16px; display: none; }
.pe-upload-preview img   { max-width: 100%; border-radius: 10px; max-height: 200px; object-fit: cover; }
.pe-skip                 { text-align: center; margin-top: 14px; }
.pe-skip button          { background: none; border: none; color: var(--pe-grey); font-size: 14px; cursor: pointer; text-decoration: underline; font-family: inherit; }

/* Contact fields */
.pe-fields { display: flex; flex-direction: column; gap: 16px; }
.pe-field label      { display: block; font-size: 13px; font-weight: 600; color: var(--pe-mid); margin-bottom: 6px; }
.pe-field input      { width: 100%; padding: 14px 16px; border: 2px solid #E2E8F0; border-radius: 10px; font-size: 15px; transition: border-color 0.2s; outline: none; color: var(--pe-dark); font-family: inherit; box-sizing: border-box; }
.pe-field input:focus { border-color: var(--pe-brand); }
.pe-optional          { font-size: 12px; color: var(--pe-grey); font-weight: 400; margin-left: 4px; }

/* Nav */
.pe-nav       { display: flex; gap: 12px; margin-top: 28px; }
.pe-btn-back  { background: var(--pe-light); border: none; border-radius: 10px; padding: 14px 24px; font-size: 15px; cursor: pointer; color: var(--pe-mid); transition: background 0.2s; font-family: inherit; }
.pe-btn-back:hover { background: #E2E8F0; }
.pe-btn-next  { flex: 1; background: var(--pe-brand); color: #fff; border: none; border-radius: 10px; padding: 14px 24px; font-size: 16px; font-weight: 700; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; }
.pe-btn-next:hover    { filter: brightness(1.1); }
.pe-btn-next:disabled { background: #CBD5E8; cursor: not-allowed; }
.pe-btn-next.pe-submit { background: var(--pe-green); }
.pe-btn-next.pe-loading { opacity: 0.7; pointer-events: none; }

.pe-error { color: #cc0000; font-size: 13px; margin-top: 8px; display: none; }

/* Result */
.pe-result { padding: 40px; text-align: center; }
.pe-result-icon  { font-size: 56px; margin-bottom: 16px; }
.pe-result-title { font-size: 24px; font-weight: 700; color: var(--pe-dark); margin: 0 0 8px; }
.pe-estimate-box {
  background: linear-gradient(135deg, var(--pe-brand), #4D8EFF);
  color: #fff;
  border-radius: 16px;
  padding: 24px 32px;
  margin: 24px auto;
  display: inline-block;
  min-width: 240px;
}
.pe-estimate-box .pe-elabel  { font-size: 13px; opacity: 0.8; margin: 0 0 4px; }
.pe-estimate-box .pe-eamount { font-size: 42px; font-weight: 800; margin: 0; }
.pe-result-note  { font-size: 14px; color: var(--pe-grey); line-height: 1.7; max-width: 440px; margin: 0 auto 20px; }
.pe-result-badge {
  background: #E8FFF3;
  border: 1px solid #A0ECC8;
  border-radius: 12px;
  padding: 14px 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: #0A7A45;
  font-weight: 500;
}

/* Mobile */
@media (max-width: 600px) {
  .pe-options { grid-template-columns: 1fr; }
  .pe-body, .pe-progress-wrap { padding-left: 20px; padding-right: 20px; }
  .pe-header { padding: 24px 20px; }
  .pe-result  { padding: 28px 20px; }
  .pe-nav     { flex-direction: column-reverse; }
  .pe-btn-back { text-align: center; }
  .pe-question { font-size: 18px; }
}

/* "Other" custom text input */
.pe-other-wrap { animation: pe-in 0.2s ease; }
.pe-other-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--pe-brand);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--pe-dark);
  outline: none;
  box-sizing: border-box;
  background: var(--pe-blue-light, #E8F0FF);
  transition: border-color 0.2s;
}
.pe-other-input:focus { border-color: var(--pe-brand); box-shadow: 0 0 0 3px rgba(0,87,255,0.12); }

/* Multiple photo upload */
.pe-multi-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.pe-preview-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--pe-brand, #0057FF);
}
.pe-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pe-remove-photo {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 12px;
}
.pe-remove-photo:hover { background: #cc0000; }
