:root{--ps-bg:#f4f7fb;--ps-card:#ffffff;--ps-text:#0f172a;--ps-muted:#64748b;--ps-line:#e5e7eb;--ps-primary:#1d4ed8;--ps-primary2:#06b6d4}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,Arial,Helvetica,sans-serif;color:var(--ps-text);background:linear-gradient(180deg,#f8fbff 0%,#eef4ff 100%)}
a{text-decoration:none}
.ps-topbar{position:sticky;top:0;z-index:1000;background:rgba(255,255,255,.94);backdrop-filter:blur(10px);border-bottom:1px solid var(--ps-line)}
.ps-topbar .ps-wrap{max-width:1280px;margin:0 auto;padding:12px 16px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.ps-brand{font-weight:900;color:#0f172a;font-size:14px;line-height:1.1}
.ps-brand small{display:block;font-weight:700;color:var(--ps-muted);font-size:12px;margin-top:2px}
.ps-navlinks{display:flex;gap:10px;flex-wrap:wrap}
.ps-navlinks a{padding:10px 14px;border-radius:999px;background:#eef4ff;border:1px solid #dbeafe;color:#1d4ed8;font-weight:800;font-size:14px}
.ps-navlinks a.active{background:linear-gradient(135deg,var(--ps-primary),var(--ps-primary2));color:#fff;border-color:transparent;box-shadow:0 10px 24px rgba(29,78,216,.18)}
.ps-container{max-width:1280px;margin:0 auto;padding:22px 16px 40px}
.ps-module-shell{background:#fff;border:1px solid #dbe4f0;border-radius:24px;padding:20px;box-shadow:0 10px 30px rgba(15,23,42,.05)}
.ps-module-shell>*{max-width:100%}
.ps-footer{padding:14px 16px 32px;color:#64748b;text-align:center;font-size:13px}
@media (max-width: 900px){
  .ps-topbar .ps-wrap{flex-direction:column;align-items:flex-start}
  .ps-container{padding:16px 12px 28px}
  .ps-module-shell{padding:14px}
  .ps-navlinks a{font-size:13px;padding:9px 12px}
}

/* =========================================================
       PACHECO & SANTOS — SIMULADOR (BeTheme SAFE + iPhone FIX)
       AUTO-CÁLCULO + ÍCONES + CONTRATO (REFERÊNCIAS) + AFV
       TABELA: remove "Etapa" | "Parcela" -> "Comissão" (1º/Confirmações)
       CORREÇÃO: total da tabela acompanha corretamente o valor superior
       REGRA NOVA: Renovação 50% divide a comissão em 18x
    ========================================================= */

    #ps-simulador, #ps-simulador * { box-sizing: border-box; }

    #ps-simulador{
      --azul:#1e3c72;
      --azul2:#2a5298;
      --bg:#f4f6fb;
      --card:#ffffff;
      --muted:#6b7280;
      --text:#0f172a;
      --border:#e5e7eb;
      --warn-bg:#fff1f2;
      --warn:#b91c1c;
      --ok-bg:#ecfeff;
      --ok:#155e75;

      width:100%;
      max-width:100%;
      overflow-x:clip;
      -webkit-overflow-scrolling:touch;
      font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
      color:var(--text);
    }

    #ps-simulador input,
    #ps-simulador select,
    #ps-simulador button,
    #ps-simulador textarea { color:var(--text) !important; }
    #ps-simulador input::placeholder{ color:#9ca3af !important; opacity:1; }

    #ps-simulador .section_wrapper,
    #ps-simulador .container,
    #ps-simulador .content_wrapper,
    #ps-simulador .the_content_wrapper,
    #ps-simulador .mcb-wrap,
    #ps-simulador .mcb-wrap-inner{
      width:100% !important;
      max-width:100% !important;
    }

    #ps-simulador .wrap{
      width:100%;
      max-width:1200px;
      margin: 14px auto;
      padding-left: max(10px, env(safe-area-inset-left));
      padding-right:max(10px, env(safe-area-inset-right));
    }

    #ps-simulador .shell{
      width:100%;
      max-width:100%;
      background: var(--card);
      border-radius: 14px;
      border: 1px solid #eaeef5;
      padding: 14px;
      box-shadow:none;
      background-image: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    }

    #ps-simulador .title{
      text-align:center;
      margin: 6px 0 14px;
    }
    #ps-simulador .title h2{
      margin:0;
      font-weight: 900;
      letter-spacing:.2px;
      color: var(--azul);
      font-size: 26px;
      line-height:1.15;
    }
    #ps-simulador .title p{
      margin: 6px 0 0;
      color: var(--muted);
      font-size: 13px;
    }

    #ps-simulador .grid{
      display:grid;
      grid-template-columns: 420px 1fr;
      gap: 14px;
      align-items:start;
      min-width:0;
    }
    @media (max-width: 980px){
      #ps-simulador .grid{ grid-template-columns:1fr; }
    }

    #ps-simulador .card{
      width:100%;
      min-width:0;
      background: #fff;
      border: 1px solid #eaeef5;
      border-radius: 12px;
      padding: 12px;
      box-shadow:none;
    }

    #ps-simulador .card h3{
      margin:0 0 10px;
      font-size: 12px;
      color: var(--muted);
      font-weight: 950;
      letter-spacing: .12em;
      text-transform: uppercase;
    }

    #ps-simulador .ico{
      width:16px; height:16px;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      color: var(--azul);
      flex: 0 0 auto;
    }
    #ps-simulador .ico svg{ width:16px; height:16px; display:block; fill: currentColor; }

    #ps-simulador .field{ margin: 0 0 12px; }
    #ps-simulador .field label{
      display:flex;
      align-items:center;
      gap:8px;
      font-size: 13px;
      color: var(--muted);
      font-weight: 900;
      margin-bottom: 6px;
    }
    #ps-simulador .req{ color:#ef4444; font-weight:900; }

    #ps-simulador .control{
      width:100%;
      max-width:100%;
      min-width:0;
      padding: 12px 12px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: #fff;
      outline: none;
      font-size: 14px;
      box-shadow:none;
    }
    #ps-simulador .control:focus{
      border-color: rgba(30,60,114,.45);
      box-shadow: 0 0 0 4px rgba(30,60,114,.10);
    }

    #ps-simulador .hint{
      margin-top: 6px;
      color: #94a3b8;
      font-size: 12px;
      line-height: 1.4;
      word-break: break-word;
    }

    #ps-simulador .pill{
      display:flex;
      align-items:flex-start;
      gap:10px;
      margin-top: 10px;
      padding: 10px 12px;
      border-radius: 12px;
      background: rgba(30,60,114,.05);
      color: #1e3c72;
      font-size: 12px;
      font-weight: 800;
      line-height:1.35;
    }

    #ps-simulador .resultTop{
      display:flex;
      align-items:flex-end;
      justify-content: space-between;
      gap: 10px;
      padding: 12px 12px;
      border-radius: 12px;
      border: 1px solid #eaeef5;
      background: #fff;
      min-width:0;
    }
    #ps-simulador .resultTop .big{
      font-size: 30px;
      font-weight: 950;
      color: var(--azul);
      letter-spacing:.2px;
    }
    #ps-simulador .resultTop .meta{
      text-align:right;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
      min-width:0;
    }

    #ps-simulador .alert{
      display:none;
      margin-top: 10px;
      border-radius: 12px;
      padding: 10px 12px;
      border: 1px solid rgba(185,28,28,.25);
      background: var(--warn-bg);
      color: var(--warn);
      font-weight: 950;
      font-size: 13px;
      line-height: 1.45;
    }
    #ps-simulador .okbox{
      display:none;
      margin-top: 10px;
      border-radius: 12px;
      padding: 10px 12px;
      border: 1px solid rgba(21,94,117,.20);
      background: var(--ok-bg);
      color: var(--ok);
      font-weight: 950;
      font-size: 13px;
      line-height: 1.45;
    }

    #ps-simulador .tableWrap{
      margin-top: 10px;
      border-radius: 12px;
      border: 1px solid #eaeef5;
      background:#fff;
      overflow:hidden;
      max-width:100%;
    }
    #ps-simulador table{ width:100%; border-collapse: collapse; }
    #ps-simulador thead th{
      background:#f1f5f9;
      color:#334155;
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: .08em;
      padding: 12px 12px;
      text-align:left;
      font-weight: 950;
      white-space:nowrap;
    }
    #ps-simulador tbody td{
      padding: 12px 12px;
      border-top: 1px solid #eaeef5;
      font-size: 14px;
      color:#334155;
      white-space:nowrap;
    }
    #ps-simulador .totalRow td{
      background: #0f172a;
      color:#fff;
      font-weight: 950;
      border-top: 0;
    }

    #ps-simulador .badge{
      display:inline-flex;
      align-items:center;
      gap:6px;
      padding: 6px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 900;
      letter-spacing:.02em;
      white-space:nowrap;
    }
    #ps-simulador .b-adesao{ background:#e0f2fe; color:#075985; }
    #ps-simulador .b-manu{ background:#fff7ed; color:#9a3412; }
    #ps-simulador .b-cont{ background:#f3e8ff; color:#6b21a8; }
    #ps-simulador .b-parc{ background:#e2e8f0; color:#334155; }

    #ps-simulador .afvpill{
      display:inline-flex;
      align-items:center;
      gap:8px;
      padding: 8px 10px;
      border-radius: 999px;
      border: 1px solid #eaeef5;
      background:#fff;
      font-size: 12px;
      font-weight: 900;
      color:#334155;
      margin-top: 8px;
    }
    #ps-simulador .dot{
      width:10px; height:10px;
      border-radius: 999px;
      background:#94a3b8;
      flex: 0 0 auto;
    }
    #ps-simulador .dot.pendente{ background:#f59e0b; }
    #ps-simulador .dot.analise{  background:#3b82f6; }
    #ps-simulador .dot.recusado{ background:#ef4444; }
    #ps-simulador .dot.aprovado{ background:#22c55e; }

    #ps-simulador .panels{
      margin-top: 10px;
      display:grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      min-width:0;
    }
    @media(max-width: 980px){
      #ps-simulador .panels{ grid-template-columns:1fr; }
    }
    #ps-simulador .note{
      border-radius: 12px;
      border: 1px solid #eaeef5;
      padding: 12px 12px;
      background:#fff;
      min-width:0;
    }
    #ps-simulador .note .head{
      display:flex;
      align-items:center;
      gap:8px;
      margin:0 0 8px;
    }
    #ps-simulador .note h4{
      margin:0;
      font-size: 13px;
      color:#0f172a;
      font-weight: 950;
    }
    #ps-simulador .note p, #ps-simulador .note li{
      margin:0;
      color:#475569;
      font-size: 13px;
      line-height: 1.55;
    }
    #ps-simulador .note ul, #ps-simulador .note ol{ margin: 8px 0 0; padding-left: 18px; }
    #ps-simulador .ref{
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px dashed #e5e7eb;
      color:#64748b;
      font-size: 12px;
      line-height:1.45;
    }

    #ps-simulador .metaBlocks{
      margin-top: 10px;
      display:grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    @media(max-width: 980px){
      #ps-simulador .metaBlocks{ grid-template-columns:1fr; }
    }

    @media (max-width: 520px){
      #ps-simulador .wrap{
        max-width:100% !important;
        width:100% !important;
        margin: 8px auto !important;
        padding-left: max(10px, env(safe-area-inset-left)) !important;
        padding-right:max(10px, env(safe-area-inset-right)) !important;
      }
      #ps-simulador .shell{ padding: 12px; border-radius: 12px; }
      #ps-simulador .card{ padding: 12px; border-radius: 12px; }
      #ps-simulador .title h2{ font-size: 22px; }
      #ps-simulador .resultTop{
        flex-direction: column;
        align-items:flex-start;
      }
      #ps-simulador .resultTop .meta{
        text-align:left;
        width:100%;
      }
      #ps-simulador .resultTop .big{ font-size: 28px; }

      #ps-simulador table, #ps-simulador thead, #ps-simulador tbody, #ps-simulador th, #ps-simulador td, #ps-simulador tr{
        display:block;
        width:100%;
      }
      #ps-simulador thead{ display:none; }
      #ps-simulador tbody tr{
        border-top: 1px solid #eaeef5;
        padding: 10px 10px;
      }
      #ps-simulador tbody td{
        border:0 !important;
        padding: 8px 0 !important;
        white-space: normal !important;
        display:flex;
        align-items:flex-start;
        justify-content: space-between;
        gap: 10px;
      }
      #ps-simulador tbody td:nth-child(1)::before{ content:"Comissão"; font-weight:900; color:#64748b; font-size:12px; }
      #ps-simulador tbody td:nth-child(2)::before{ content:"%";       font-weight:900; color:#64748b; font-size:12px; }
      #ps-simulador tbody td:nth-child(3)::before{ content:"Valor";   font-weight:900; color:#64748b; font-size:12px; }
      #ps-simulador tbody td > *{ flex: 1 1 auto; text-align:right; }

      #ps-simulador .totalRow td::before{ content:"" !important; }
      #ps-simulador .totalRow td{
        background:#0f172a !important;
        color:#fff !important;
        border-radius: 10px;
        padding: 12px 10px !important;
        margin-top: 8px;
        display:flex;
        justify-content: space-between;
        align-items:center;
        gap: 10px;
      }
    }

    #ps-rotate-overlay{
      position: fixed;
      inset: 0;
      z-index: 999999;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 18px;
      background: rgba(15, 23, 42, .86);
      backdrop-filter: blur(6px);
      -webkit-backdrop-filter: blur(6px);
    }
    #ps-rotate-overlay .box{
      width: min(520px, 100%);
      background: #ffffff;
      border-radius: 18px;
      padding: 18px 16px;
      text-align: center;
      border: 1px solid rgba(15,23,42,.10);
    }
    #ps-rotate-overlay .brand{
      display:flex;
      align-items:center;
      justify-content:center;
      gap:10px;
      margin-bottom: 10px;
      color:#1e3c72;
      font-weight: 950;
      letter-spacing:.2px;
    }
    #ps-rotate-overlay .title{
      font-size: 18px;
      line-height: 1.25;
      margin: 8px 0 6px;
      color:#0f172a;
      font-weight: 950;
    }
    #ps-rotate-overlay .desc{
      margin: 0 0 14px;
      color:#475569;
      font-size: 13px;
      line-height: 1.45;
    }
    .ps-phone{
      width: 62px;
      height: 104px;
      border: 3px solid #1e3c72;
      border-radius: 14px;
      position: relative;
      margin: 8px auto 6px;
      background: linear-gradient(180deg,#f8fafc,#ffffff);
    }
    .ps-phone:before{
      content:"";
      position:absolute;
      top:7px; left:50%;
      width: 22px; height: 5px;
      border-radius: 999px;
      background:#1e3c72;
      transform: translateX(-50%);
      opacity:.75;
    }
    .ps-phone:after{
      content:"";
      position:absolute;
      bottom:7px; left:50%;
      width: 18px; height: 18px;
      border-radius: 999px;
      border: 2px solid rgba(30,60,114,.55);
      transform: translateX(-50%);
    }
    .ps-rotate-wrap{
      display: inline-block;
      animation: ps-rotate 1.3s ease-in-out infinite;
      transform-origin: 50% 60%;
    }
    @keyframes ps-rotate{
      0%   { transform: rotate(0deg) translateY(0); }
      30%  { transform: rotate(-10deg) translateY(-2px); }
      60%  { transform: rotate(90deg) translateY(-2px); }
      100% { transform: rotate(90deg) translateY(0); }
    }
    .ps-arrows{
      display:flex;
      gap: 10px;
      justify-content:center;
      margin-top: 10px;
      color:#1e3c72;
      font-weight: 950;
      font-size: 18px;
      opacity:.9;
    }
    #ps-rotate-overlay .hint{
      margin-top: 10px;
      font-size: 12px;
      color:#64748b;
    }

/* limpeza visual do módulo comissão */
#ps-simulador{
  font-family:'Inter',Arial,Helvetica,sans-serif!important;
  color:#0f172a!important;
}
#ps-simulador .wrap{max-width:100%!important;margin:0 auto!important}
#ps-simulador .shell{
  border:none!important;
  box-shadow:none!important;
  background:transparent!important;
  padding:0!important;
}
#ps-simulador .title{
  margin:0 0 14px!important;
  text-align:left!important;
}
#ps-simulador .title h2{
  font-family:'Inter',Arial,Helvetica,sans-serif!important;
  color:#0f172a!important;
  font-weight:900!important;
  letter-spacing:-.03em!important;
}
#ps-simulador .title p{
  color:#64748b!important;
}
#ps-simulador .card{
  border-radius:20px!important;
  box-shadow:none!important;
  border:1px solid #dbe4f0!important;
}


/* compactação visual */
.ps-page .hero{border-radius:18px!important;margin:0 0 12px!important}
.ps-page .card-shell{border-radius:18px!important}
.ps-page .metric,.ps-page .cons-section,
#ps-simulador .card,
.repasse-app .card{
  border-radius:16px!important;
}
.ps-page input,.ps-page select,.ps-page button,
#ps-simulador input,#ps-simulador select,#ps-simulador button,
.repasse-app input,.repasse-app select,.repasse-app button{
  font-size:14px!important;
}
#ps-simulador .title h2{font-size:2rem!important}
.repasse-app h1{font-size:2.05rem!important}
.repasse-app h2{font-size:1.35rem!important}
.repasse-app h3{font-size:1.05rem!important}
.repasse-app .result-box .value{font-size:2rem!important}
@media (max-width:768px){
  #ps-simulador .title h2{font-size:1.65rem!important}
  .repasse-app h1{font-size:1.75rem!important}
  .repasse-app .result-box .value{font-size:1.55rem!important}
}
