:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(0,0,0,.06);
  --orange: #ff7b00;
  --orange2: #ff8f2b;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #f59e0b;
  --radius: 16px;

  /* ✅ Theme (default QP) */
  --primary: #ff7b00;
  --primary2: #ff8f2b;          /* para gradientes si quieres */
  --primary-rgb: 255,123,0;     /* para rgba() */
  --on-primary: #111;           /* texto sobre primary */
}

*{ box-sizing: border-box; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page{
  width: min(920px, 92vw);
  margin: 28px auto 60px;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px;
  margin-bottom: 14px;
}

.header{
  text-align:center;
  padding: 22px 18px;
}
.brand{
  display:flex;
  justify-content:center;
  margin-bottom: 10px;
}
.logo{
  font-weight: 900;
  letter-spacing: .2px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,123,0,.10);
  color: var(--orange);
}

h1{ margin: 6px 0 6px; font-size: 28px; }
h2{ margin: 0 0 12px; font-size: 18px; }
.muted{ color: var(--muted); }
.form{ margin-top: 10px; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid-2{
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 720px){
  .grid{ grid-template-columns: 1fr; }
  h1{ font-size: 24px; }
}

.field label{
  display:block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
}

.field input, .field select{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline: none;
  font-size: 14px;
  background: #fff;
}
.field input:focus{
   border-color: rgba(var(--primary-rgb), .55);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .12);
}

.field textarea, .field textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline: none;
  font-size: 14px;
  background: #fff;
}
.field textarea:focus{
  border-color: rgba(var(--primary-rgb), .55);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .12);
}

.hint{
  display:block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.error{
  display:block;
  min-height: 16px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
}

.inputError{
  border-color: rgba(220,38,38,.7) !important;
  box-shadow: 0 0 0 4px rgba(220,38,38,.08) !important;
}

.phone{
  display:flex;
  align-items:center;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow:hidden;
}
.phone .prefix{
  padding: 12px 12px;
  background: #f3f4f6;
  border-right: 1px solid var(--border);
  font-weight: 700;
  color: #374151;
}
.phone input{
  border:0;
  border-radius: 0;
  box-shadow: none !important;
}

.passwrap{
  display:flex;
  align-items:center;
  gap: 8px;
}
.passwrap input{ flex:1; }
.iconbtn{
  border: 1px solid var(--border);
  background:#fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
}
.iconbtn:hover{ border-color: rgba(255,123,0,.35); }

.strength{
  margin-top: 10px;
}
.strength .bar{
  height: 10px;
  border-radius: 999px;
  background: #eef2f7;
  overflow:hidden;
  border: 1px solid var(--border);
}
.strength .bar span{
  display:block;
  height:100%;
  width: 0%;
  background: var(--danger);
  transition: width .2s ease;
}
.strength .row{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.strength .row strong{
  font-size: 13px;
}
.strength .row #strengthHelp{
  font-size: 12px;
}

.photoBox{
  display:grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items:center;
}
@media (max-width: 720px){
  .photoBox{ grid-template-columns: 1fr; }
}
.photoPreview{
  width: 220px;
  height: 220px;
  border-radius: 18px;
  border: 1px dashed var(--border);
  background: #fafafa;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.photoPreview img{
  width:100%;
  height:100%;
  object-fit: cover;
}

.segmented{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
}
.seg{
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  user-select:none;
  background:#fff;
}
.seg input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}
.seg span{
  font-weight: 700;
  font-size: 14px;
}
.seg:has(input:checked){
  border-color: rgba(var(--primary-rgb), .55);
  background: rgba(var(--primary-rgb), .10);
}

.policy{
  margin-bottom: 14px;
}
.check{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  font-weight: 700;
}
.check input{
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.check a{
 color: var(--primary);
  text-decoration: none;
}
.check a:hover{ text-decoration: underline; }

.btnPrimary{
  width:100%;
  border:0;
  border-radius: 14px;
  padding: 14px 14px;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  color:#fff;
  font-weight: 900;
  font-size: 15px;
  cursor:pointer;
}
.btnPrimary:disabled{
  opacity: .6;
  cursor:not-allowed;
}

.formMsg{
  margin-top: 12px;
  padding: 12px 12px;
  border-radius: 12px;
  display:none;
  border: 1px solid var(--border);
}
.formMsg.ok{
  display:block;
  border-color: rgba(22,163,74,.35);
  background: rgba(22,163,74,.08);
  color: #065f46;
}
.formMsg.bad{
  display:block;
  border-color: rgba(220,38,38,.35);
  background: rgba(220,38,38,.08);
  color: #7f1d1d;
}

.footnote{
  margin: 10px 0 0;
  text-align:center;
  font-size: 12px;
}
/* ===== Foto (nuevo diseño) ===== */
.photoCard{
  display:flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 4px;
  text-align: center;
}

.photoMeta{
  width: 100%;
  max-width: 520px;
  display:flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

@media (max-width: 720px){
  .photoCard{
    flex-direction: column;
    align-items: center;
    text-align:center;
  }
  .photoMeta{
    width:100%;
  }
}

.photoCircle{
  width: 180px;
  height: 180px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fafafa;
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  position: relative;
}

.photoCircle img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.photoIcon{
  font-size: 42px;
  opacity: .55;
}

.photoEmptyText{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.btnPhoto{
  width: min(420px, 100%);
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  color:#fff;
  font-weight: 900;
  cursor:pointer;
}

.btnPhoto:active{
  transform: translateY(1px);
}

.photoRemove{
  position:absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.9);
  cursor:pointer;
  font-weight: 900;
  display:none; /* solo aparece cuando hay foto */
}

.photoRemove:hover{
  border-color: rgba(255,123,0,.55);
}


/* ===== Modal ===== */
.modal{ display:none; }
.modal.open{ display:block; }

.modalBackdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.45);
  z-index: 999;
}

.modalDialog{
  position:fixed;
  left:50%;
  top:50%;
  transform: translate(-50%, -50%);
  width: min(780px, 92vw);
  max-height: 85vh;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  z-index: 1000;
  display:flex;
  flex-direction: column;
  overflow:hidden;
}

.modalHeader{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
}

.modalHeader h3{
  margin:0;
  font-size: 16px;
}

.modalClose{
  border:1px solid var(--border);
  background:#fff;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor:pointer;
  font-weight: 900;
}

.modalBody{
  padding: 14px 14px;
  overflow:auto;
}

.modalBody h4{ margin: 14px 0 6px; }
.modalBody p, .modalBody li{ color: #374151; font-size: 14px; line-height: 1.5; }
.modalBody ul{ margin: 6px 0 0 18px; }

.modalFooter{
  padding: 14px 14px;
  border-top: 1px solid var(--border);
}

/* ===== Modal Header Brand ===== */
.modalBrand{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}

.modalLogo{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255,123,0,.10);
  border: 1px solid rgba(255,123,0,.18);
  padding: 6px;
}

.modalTitleWrap{
  display:flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.modalSubtitle{
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ===== Foto: X fuera del círculo ===== */
.photoPreviewWrap{
  position: relative;
  width: 180px;
  height: 180px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.photoRemove{
  position:absolute;
  top: -10px;
  right: -10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.95);
  cursor:pointer;
  font-weight: 900;
  display:none; /* solo aparece cuando hay foto */
  box-shadow: 0 10px 20px rgba(0,0,0,.10);
}

.photoRemove:hover{
  border-color: rgba(255,123,0,.55);
}

/* ===== Header logo badge ===== */
.logoBadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 12px;
  border-radius: 999px;
}

.logoImg{
  width: auto;
  height: 250px;
  object-fit: contain;
  display:block;
}
.brandText{
  margin: 8px 0 0;
  font-weight: 900;
  color: var(--orange);
}

/* ===== Botón ir al inicio ===== */
.btnScrollTop{
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9999;

  padding: 8px 14px;
  border-radius: 999px;

  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.08);
  color: #111;

  font-weight: 700;
  font-size: 13px;

  box-shadow: 0 10px 20px rgba(0,0,0,.12);
  cursor: pointer;

  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: all .25s ease;
}

.btnScrollTop:hover{
  background: #fff;
  border-color: rgba(255,123,0,.45);
}

.btnScrollTop.show{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ===== Barra superior Inicio ===== */
.topNav{
  width: 100%;
  padding: 10px 14px;
  position: sticky;
  top: 0;
  z-index: 1000;

  background: var(--primary);
  border-bottom: 1px solid rgba(0,0,0,.05);
}

.btnInicio{
  display: inline-flex;
  align-items: center;
  gap: 6px;

  font-size: 14px;
  font-weight: 800;

  color: var(--on-primary);
  text-decoration: none;

  padding: 6px 12px;
  border-radius: 999px;

  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);

  transition: all .2s ease;
}

.btnInicio:hover{
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.30);
}

/* ===== Co-Branding Header ===== */
.brandCo{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.coLeft, .coRight{
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  gap: 6px;
}

.coDivider{
  color: rgba(0,0,0,.25);
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
}

.opBadge, .qpBadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,123,0,.10);
  border: 1px solid rgba(255,123,0,.18);
}

.opLogo{
  width: 120px;
  height: 40px;
  object-fit: contain;
  display:block;
}

.qpLogo{
  width: 140px;
  height: 38px;
  object-fit: contain;
  display:block;
}

.opName{
  margin: 0;
  font-weight: 900;
  font-size: 25px;
  color: #111827;
  max-width: 220px;
  text-align:center;
  overflow:hidden;
}

.poweredText{
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

@media (max-width: 520px){
  .opLogo{ width: 110px; height: 38px; }
  .qpLogo{ width: 130px; height: 36px; }
  .coDivider{ display:none; }
}


/* ===== Brand Switch (token/no token) ===== */
.brandSwitch{
  display:flex;
  justify-content:center;
  margin-bottom: 10px;
}

.brandDefault,
.brandOperator{
  display:flex;
  flex-direction: column;
  align-items:center;
  gap: 8px;
}

.operatorBadge{
  background: rgba(0,0,0,.04);
  border: 1px solid rgba(0,0,0,.08);
}

/* Marca del operador más grande */
.operatorLogo{
  width: 240px;
  height: 62px;
  object-fit: contain;
  display:block;
}

.poweredBy{
  margin: 0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2px;
  color: var(--muted);
}

.qpOrange{
  color: var(--orange);
  font-weight: 900;
}
/* ===== Modal PRO éxito ===== */
.qpModal { position: fixed; inset: 0; display: none; z-index: 9999; }
.qpModal[aria-hidden="false"] { display: block; }

.qpModalBackdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
}

.qpModalCard{
  position: relative;
  width: min(520px, calc(100% - 28px));
  margin: 10vh auto 0;
  background: #0f1217;
  color: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  transform: translateY(10px);
  animation: qpPop .18s ease-out forwards;
}

@keyframes qpPop { to { transform: translateY(0); } }

.qpModalHeader{
  display: flex; gap: 14px; align-items: center;
  padding: 16px 16px 12px 16px;
  background: linear-gradient(180deg, rgba(255,123,0,.18), rgba(15,18,23,0));
}

.qpSuccessIcon{
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(46, 204, 113, .18);
  border: 1px solid rgba(46, 204, 113, .35);
  font-size: 22px; font-weight: 900;
}

.qpModalHeaderText{ flex: 1; }
.qpModalTitle{ font-size: 18px; font-weight: 900; letter-spacing: .2px; }
.qpModalSub{ font-size: 13px; opacity: .8; margin-top: 2px; }

.qpModalX{
  width: 36px; height: 36px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
}

.qpModalBody{ padding: 12px 16px 6px 16px; }

.qpInfoCard{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 12px;
}

.qpInfoRow{ display:flex; justify-content: space-between; gap: 10px; }
.qpInfoLabel{ font-size: 12px; opacity: .78; }
.qpInfoValue{ font-size: 13px; font-weight: 800; color: #ffb26b; word-break: break-word; text-align: right; }

.qpInfoDivider{ height: 1px; background: rgba(255,255,255,.08); margin: 10px 0; }

.qpHint{
  margin-top: 10px;
  font-size: 12px;
  opacity: .85;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,123,0,.08);
  border: 1px solid rgba(255,123,0,.18);
}

.qpModalFooter{
  padding: 14px 16px 16px 16px;
  display:flex; justify-content: flex-end;
}

.qpBtnPrimary{
  width: 100%;
  border: none;
  cursor: pointer;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 900;
  color: #0f1217;
  background: #ff7b00;
}

.qpBtnPrimary:active{ transform: scale(.99); }


/* ===== Modal Fullscreen Mapa ===== */
.qpMapModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}
.qpMapModal.open { display: block; }

.qpMapBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}

.qpMapSheet {
  position: absolute;
  inset: 0;
  background: #0f0f10;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.qpMapHeader {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
}

.qpMapSub {
  display:block;
  font-size: 12px;
  opacity: .8;
  margin-top: 2px;
}

.qpMapBody { position: relative; flex: 1; }
.qpMapCanvas { width: 100%; height: 100%; }

.qpMapLock {
  position: absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  text-align:center;
  padding: 16px;
  background: rgba(0,0,0,.45);
  font-weight: 700;
}

.qpMapFooter {
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
}

.qpMapCoords { font-size: 13px; opacity: .9; }

.qpMapBtn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}
.qpMapBtn.primary { background: #ff7b00; color: #111; }
.qpMapBtn.primary:disabled { opacity: .5; cursor: not-allowed; }
.qpMapBtn.ghost { background: rgba(255, 255, 255, 0.774); color: #000; }


/* ===== Modal Categorías ===== */
.qpCatModal{position:fixed; inset:0; z-index:9999; display:none;}
.qpCatModal.open{display:block;}
.qpCatBackdrop{position:absolute; inset:0; background:rgba(0,0,0,.55);}
.qpCatSheet{
  position:absolute; left:0; right:0; bottom:0;
  background:#fff; border-radius:18px 18px 0 0;
  max-height:85vh; overflow:hidden;
}
.qpCatHeader{
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 16px; border-bottom:1px solid #eee;
}
.qpCatBody{padding:14px 16px; overflow:auto; max-height:75vh;}
.qpCatGrid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}
@media(min-width:768px){
  .qpCatSheet{left:50%; transform:translateX(-50%); width:520px; border-radius:18px;}
}

/* Card categoría */
.qpCatItem{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px; border-radius:14px;
  border:1px solid rgba(0,0,0,.08);
  cursor:pointer; user-select:none;
}
.qpCatSwatch{
  width:46px; height:46px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  flex:0 0 auto;
}
.qpCatSwatch img{width:28px; height:28px; object-fit:contain; filter:drop-shadow(0 2px 6px rgba(0,0,0,.18));}
.qpCatName{font-weight:700; margin:0; line-height:1.1;}
.qpCatDesc{margin:2px 0 0; font-size:12px; opacity:.75;}
.qpCatItem:hover{transform:translateY(-1px);}

/* item base ya lo tienes como .qpCatItem */
.qpCatItem.is-selected{
  outline: 2px solid var(--primary, #ff7b00);
  box-shadow: 0 0 0 4px rgba(255, 123, 0, .18);
  border-radius: 14px;
  position: relative;
}

.qpCatItem.is-selected::after{
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary, #ff7b00);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
}

/* 🔥 Evita GPU overload (móvil + WebGL + blur) */
@media (max-width: 720px){
  .qpMapHeader,
  .qpMapFooter,
  .qpMapBackdrop{
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* Si quieres también en general (no solo móvil) */
.qpMapModal.open .qpMapHeader,
.qpMapModal.open .qpMapFooter,
.qpMapModal.open .qpMapBackdrop{
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.field input:focus,
.field textarea:focus,
.field select:focus{
  border-color: rgba(var(--primary-rgb), .55);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .12);
}