/* ============================================================
   ONDEBUS APP — CSS base estável
   Sem menu hambúrguer
   ============================================================ */

:root{
  --ob-blue:#0b57d0;
  --ob-blue-dark:#0849ad;
  --ob-blue-soft:#e8f1ff;
  --ob-bg:#f4f7fb;
  --ob-card:#ffffff;
  --ob-text:#101828;
  --ob-muted:#667085;
  --ob-border:#e4e7ec;
  --ob-shadow:0 8px 24px rgba(16,24,40,.08);
  --ob-radius:18px;
  --ob-bottom-nav:72px;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;}

body{
  min-height:100vh;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  background:var(--ob-bg);
  color:var(--ob-text);
  line-height:1.45;
  padding-bottom:calc(var(--ob-bottom-nav) + env(safe-area-inset-bottom));
}

a{color:inherit;text-decoration:none;}
a:hover{text-decoration:none;}
img{display:block;max-width:100%;height:auto;}
button,input,select,textarea{font-family:inherit;}
button{border:0;background:transparent;cursor:pointer;}
input,select,textarea{font-size:100%;outline:none;}
:focus-visible{outline:3px solid rgba(11,87,208,.32);outline-offset:2px;}

.container,
.app-shell{
  width:100%;
  max-width:1120px;
  margin:0 auto;
  padding-left:14px;
  padding-right:14px;
}

/* Header */
.app-header{
  position:sticky;
  top:0;
  z-index:1000;
  background:#0b57d0;
  color:#fff;
  box-shadow:0 4px 16px rgba(11,87,208,.20);
}

.app-header-inner{
  max-width:1120px;
  margin:0 auto;
  padding:10px 14px;
  display:flex;
  align-items:center;
  gap:10px;
}

.app-brand{
  display:flex;
  align-items:center;
  flex:0 0 auto;
}

.app-brand img{
  width:132px;
  max-height:32px;
  object-fit:contain;
}

.app-header-text{
  display:flex;
  flex-direction:column;
  line-height:1.15;
  min-width:0;
  margin-right:auto;
}

.app-header-text strong{
  font-size:.92rem;
  font-weight:800;
  white-space:nowrap;
}

.app-header-text span{
  font-size:.72rem;
  color:rgba(255,255,255,.82);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ob-cookies-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-top:8px;
  padding:9px 11px;
  border-radius:12px;
  background:#f2f4f7;
  color:var(--ob-text);
  font-weight:700;
  font-size:.86rem;
}

/* Hero */
.app-hero{padding:14px 0 12px;}

.app-hero-content{
  border-radius:22px;
  background:linear-gradient(135deg,#0b57d0,#073b91);
  color:#fff;
  padding:20px 16px;
  box-shadow:0 10px 26px rgba(11,87,208,.22);
}

.app-badge{
  display:inline-flex;
  padding:5px 9px;
  border-radius:999px;
  background:rgba(255,255,255,.16);
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.04em;
  margin-bottom:9px;
}

.planner-title{
  font-size:clamp(1.65rem,5vw,2.4rem);
  line-height:1.08;
  font-weight:900;
  margin:0 0 8px;
}

.planner-sub{
  font-size:.98rem;
  line-height:1.5;
  color:var(--ob-muted);
  margin:0;
}

.app-hero .planner-sub{
  color:rgba(255,255,255,.90);
  max-width:720px;
}

.quick-actions{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-top:16px;
}

.quick-action{
  min-height:44px;
  padding:9px 8px;
  border-radius:14px;
  background:rgba(255,255,255,.14);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-size:.84rem;
  font-weight:800;
}

.quick-action:hover{background:rgba(255,255,255,.22);}
.install-hint{margin-top:12px;color:rgba(255,255,255,.90)!important;}

/* Cards */
.card{
  background:#fff;
  border:1px solid var(--ob-border);
  border-radius:var(--ob-radius);
  padding:16px;
  box-shadow:var(--ob-shadow);
}

.section-heading{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin-bottom:14px;
}

.section-heading.compact{margin-top:14px;}

.section-icon{
  width:38px;
  height:38px;
  border-radius:13px;
  background:var(--ob-blue-soft);
  color:var(--ob-blue);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  font-size:1.05rem;
}

.section-heading h2{
  font-size:1.06rem;
  font-weight:850;
  margin:0 0 2px;
}

.section-heading p{
  font-size:.9rem;
  color:var(--ob-muted);
  margin:0;
}

/* Grid */
.planner-layout{
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr);
  gap:16px;
  align-items:start;
  padding-bottom:24px;
}

.side-card{
  position:sticky;
  top:74px;
}

.row{
  display:grid;
  gap:12px;
}

.row.cols-2{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

/* Form */
.campo{
  position:relative;
  min-width:0;
}

.campo label,
.small{
  display:block;
  font-size:.84rem;
  font-weight:700;
  color:var(--ob-muted);
  margin-bottom:6px;
}

.campo-icone{
  position:absolute;
  left:12px;
  top:39px;
  z-index:2;
  pointer-events:none;
  opacity:.85;
}

.input{
  width:100%;
  min-height:48px;
  border:1px solid var(--ob-border);
  border-radius:14px;
  background:#fff;
  color:var(--ob-text);
  padding:11px 12px 11px 40px;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}

.input:focus{
  border-color:var(--ob-blue);
  box-shadow:0 0 0 4px rgba(11,87,208,.12);
}

.input::placeholder{color:#98a2b3;}

.acoes-form{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
  margin-top:14px;
}

.btn,
.btn-maps{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:44px;
  padding:10px 15px;
  border-radius:999px;
  font-size:.92rem;
  font-weight:800;
  border:1px solid transparent;
  text-decoration:none;
}

.btn-primary,
.btn-primary-app,
.btn-maps{
  background:var(--ob-blue);
  color:#fff;
  box-shadow:0 8px 18px rgba(11,87,208,.18);
}

.btn-primary:hover,
.btn-primary-app:hover,
.btn-maps:hover{
  background:var(--ob-blue-dark);
}

.btn-sec{
  background:#f2f4f7;
  color:var(--ob-text);
  border-color:#eaecf0;
}

.btn-sec:hover{background:#e8eef8;}

.btn-location{
  margin-top:8px;
  min-height:40px;
  font-size:.86rem;
}

.loc-status{
  margin-top:6px;
  font-weight:500;
}

.acoes-form .btn-primary-app{
  flex:1 1 210px;
}

/* Alertas, passos e texto */
.ob-alert{
  margin-top:14px;
  margin-bottom:14px;
  padding:12px 13px;
  border-radius:15px;
  font-size:.94rem;
  line-height:1.45;
}

.ob-alert-info{
  background:var(--ob-blue-soft);
  border:1px solid #c7dbff;
  color:#073b91;
}

.ob-alert-error{
  background:#fff4e5;
  border:1px solid #ffd5a8;
  color:#8a3c0f;
}

.steps-block{margin-top:8px;}

.planner-sub-steps{
  margin-bottom:8px;
  font-weight:850;
  color:var(--ob-text);
}

.lista-passos{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:8px;
}

.lista-passos .passo{
  padding:12px;
  border:1px solid var(--ob-border);
  border-radius:15px;
  background:#fff;
}

.lista-passos .passo-cabecalho{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:6px;
}

.lista-passos .passo-numero{
  font-weight:850;
  font-size:.9rem;
  color:var(--ob-blue);
}

.lista-passos .etiqueta-modo{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:4px 9px;
  border-radius:999px;
  font-size:.76rem;
  font-weight:800;
  background:#f2f4f7;
}

.lista-passos .passo-texto{
  font-size:.94rem;
  margin-bottom:4px;
  line-height:1.55;
}

.lista-passos .passo-dist,
.lista-passos .passo-meta{
  font-size:.82rem;
  color:var(--ob-muted);
}

.planner-note{
  margin-top:12px;
  font-size:.84rem;
  color:var(--ob-muted);
  line-height:1.45;
}

/* Alertas, ad, mapa */
#ob-alertas{
  background:#f8fbff;
  border:1px solid rgba(11,87,208,.10);
  padding:14px;
  border-radius:16px;
}

#ob-alertas-list{
  display:grid;
  gap:10px;
  margin-top:8px;
}

.ob-alertas-loading{
  margin:0;
  color:var(--ob-muted);
  font-size:.9rem;
  font-style:italic;
}

.ad-placeholder{
  margin-top:14px;
  padding:13px;
  border-radius:16px;
  background:linear-gradient(135deg,#ecfdf3,#f7fee7);
  border:1px solid #bbf7d0;
  color:#14532d;
  display:grid;
  gap:4px;
}

.ad-placeholder strong{font-size:.96rem;}
.ad-placeholder span{font-size:.88rem;}

#map{
  width:100%;
  height:360px;
  min-height:320px;
  border-radius:18px;
  overflow:hidden;
  border:1px solid var(--ob-border);
  background:#dbeafe;
}

/* Autocomplete */
.ob-sugestoes{
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 6px);
  max-height:260px;
  overflow-y:auto;
  background:#fff;
  border:1px solid var(--ob-border);
  border-radius:14px;
  box-shadow:0 16px 34px rgba(16,24,40,.14);
  z-index:9999;
  display:none;
}

.ob-sugestoes button,
.ob-sugestoes .ob-sugestao{
  width:100%;
  padding:10px 12px;
  background:#fff;
  border:0;
  border-bottom:1px solid #f2f4f7;
  text-align:left;
  color:var(--ob-text);
  font-size:.9rem;
  cursor:pointer;
}

.ob-sugestoes button:hover,
.ob-sugestoes .ob-sugestao:hover{
  background:var(--ob-blue-soft);
  color:var(--ob-blue);
}

/* Partida / chegada */
#passos-rota .passo:first-child:not(:only-child){
  border-color:rgba(11,87,208,.24);
  background:rgba(11,87,208,.055);
}

#passos-rota .passo:last-child:not(:only-child){
  border-color:rgba(22,163,74,.26);
  background:rgba(22,163,74,.06);
}

#passos-rota .passo:first-child:not(:only-child) .passo-cabecalho::after{
  content:"PARTIDA";
  margin-left:auto;
  font-size:.68rem;
  font-weight:900;
  letter-spacing:.06em;
  padding:4px 9px;
  border-radius:999px;
  color:var(--ob-blue);
  background:rgba(11,87,208,.12);
}

#passos-rota .passo:last-child:not(:only-child) .passo-cabecalho::after{
  content:"CHEGADA";
  margin-left:auto;
  font-size:.68rem;
  font-weight:900;
  letter-spacing:.06em;
  padding:4px 9px;
  border-radius:999px;
  color:#0f766e;
  background:rgba(22,163,74,.12);
}

.ob-time{
  display:inline-block;
  font-weight:850;
  padding:2px 8px;
  border-radius:999px;
  font-size:.85rem;
  line-height:1.6;
  margin:0 2px;
  border:1px solid transparent;
}

.ob-time--dep{
  color:var(--ob-blue);
  background:rgba(11,87,208,.10);
  border-color:rgba(11,87,208,.18);
}

.ob-time--arr{
  color:#0f766e;
  background:rgba(22,163,74,.10);
  border-color:rgba(22,163,74,.20);
}

/* Bottom nav */
.app-bottom-nav{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:1100;
  height:calc(var(--ob-bottom-nav) + env(safe-area-inset-bottom));
  padding:7px 8px calc(7px + env(safe-area-inset-bottom));
  background:rgba(255,255,255,.96);
  border-top:1px solid var(--ob-border);
  box-shadow:0 -8px 26px rgba(16,24,40,.12);
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:4px;
}

.app-bottom-nav a{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-width:0;
  border-radius:14px;
  color:var(--ob-muted);
  font-weight:800;
  font-size:.72rem;
}

.app-bottom-nav a span{
  font-size:1.12rem;
  line-height:1;
  margin-bottom:3px;
}

.app-bottom-nav a small{
  font-size:.66rem;
  white-space:nowrap;
}

.app-bottom-nav a.active,
.app-bottom-nav a:hover{
  background:var(--ob-blue-soft);
  color:var(--ob-blue);
}

/* Footer e cookies */
.app-footer{
  padding:16px 0 88px;
  color:var(--ob-muted);
  text-align:center;
  font-size:.84rem;
}

.app-footer a,
.app-footer .ob-cookies-btn{
  color:var(--ob-blue);
  font-weight:800;
  background:transparent;
  margin:0;
  padding:0;
  display:inline;
}

.ob-consent{
  position:fixed;
  left:14px;
  right:14px;
  bottom:calc(var(--ob-bottom-nav) + 16px + env(safe-area-inset-bottom));
  z-index:2000;
  max-width:520px;
  margin:0 auto;
  padding:16px;
  border-radius:20px;
  background:#fff;
  border:1px solid var(--ob-border);
  box-shadow:0 18px 46px rgba(16,24,40,.22);
}

.ob-consent__title{
  font-size:1.08rem;
  margin-bottom:8px;
}

.ob-consent__text{
  color:var(--ob-muted);
  font-size:.9rem;
  margin-bottom:12px;
}

.ob-switch{margin:8px 0;}

.ob-switch label{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:.9rem;
}

.ob-consent__buttons{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}

.btn-link{
  background:transparent;
  color:var(--ob-muted);
  box-shadow:none;
}

/* Texto grande */
body.rota-grande{font-size:18px;}

body.rota-grande #resumo-rota,
body.rota-grande .passo-texto{
  font-size:1.15rem;
}

body.rota-grande .passo-meta,
body.rota-grande .passo-dist{
  font-size:1rem;
}

/* Responsivo */
@media(max-width:900px){
  .planner-layout{grid-template-columns:1fr;}
  .side-card{position:static;}
  .row.cols-2{grid-template-columns:1fr;}
  .quick-actions{grid-template-columns:repeat(2,minmax(0,1fr));}
  #map{height:320px;}
}

@media(max-width:560px){
  .container,
  .app-shell{
    padding-left:10px;
    padding-right:10px;
  }

  .app-header-inner{
    padding:9px 10px;
  }

  .app-brand img{
    width:118px;
  }

  .app-header-text span{
    display:none;
  }

  .app-hero{
    padding-top:10px;
  }

  .app-hero-content{
    padding:18px 14px;
    border-radius:20px;
  }

  .planner-title{
    font-size:1.8rem;
  }

  .quick-action{
    min-height:42px;
    font-size:.82rem;
  }

  .card{
    padding:14px;
    border-radius:16px;
  }

  .acoes-form{
    display:grid;
    grid-template-columns:1fr;
  }

  .acoes-form .btn,
  .btn-location,
  #btn-submit,
  #btn-inverter{
    width:100%;
  }

  #map{
    height:290px;
  }

  .ob-sugestoes{
    max-height:220px;
  }
}