/* ===== RESET Y TOKENS ===== */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box;}
:root{
  --blue:#2196F3;--blue2:#1565C0;--blue-light:#e3f2fd;--blue-dim:rgba(33,150,243,0.12);
  --cyan:#00c6ff;--green:#10b981;--green-dim:rgba(16,185,129,0.12);
  --orange:#f59e0b;--red:#ef4444;--red-dim:rgba(239,68,68,0.12);
  --purple:#8b5cf6;
  --bg:#f0f4f8;--white:#ffffff;--surface:#f8fafc;
  --card:#ffffff;--border:#e2e8f0;--border2:#cbd5e1;
  --text:#0f172a;--text2:#475569;--text3:#94a3b8;
  --shadow:0 2px 16px rgba(15,23,42,0.08);
  --shadow-lg:0 8px 40px rgba(15,23,42,0.14);
  --radius:16px;--radius-sm:10px;
}
html,body{height:100%;font-family:'Plus Jakarta Sans',sans-serif;background:var(--bg);color:var(--text);overflow:hidden;}
button{cursor:pointer;font-family:inherit;border:none;outline:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;}
input,select,textarea{font-family:inherit;outline:none;}
::-webkit-scrollbar{width:4px;}
::-webkit-scrollbar-thumb{background:var(--border2);border-radius:99px;}

/* Aisla rebotes del viewport para que el gesto se sienta consistente en mobile */
html,body,.phone-frame{overscroll-behavior:none;}

/* ===== SCROLL TÁCTIL FLUIDO ===== */
/* Momentum + overscroll en todos los contenedores verticales */
.login-body,.suggestion-list,.choose-body,
#screen-driver-found,#screen-trip,#screen-arrived,
#screen-profile,#screen-history,#screen-payments,#screen-promo,
#history-list,#payments-list,.profile-body,.chat-message-list{
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-y:contain;
  scroll-behavior:smooth;
}
/* Scroll horizontal fluido */
.quick-dests,.history-filter{
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  scroll-behavior:smooth;
  touch-action:pan-x;
}
/* Forzar gesto vertical en secciones con scroll táctil */
.screen,.login-body,.suggestion-list,.choose-body,.df-body,.trip-body,
#history-list,#payments-list,.profile-body,.chat-message-list,.peer-comments-list{
  touch-action:pan-y;
}

/* Extra suavidad en autenticacion (login/registro/verificacion) */
#screen-login,#screen-register,#screen-verify,.login-body{
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-y:contain;
  will-change:scroll-position;
  transform:translateZ(0);
  backface-visibility:hidden;
}
/* Eliminar delay de 300ms en todos los elementos táctiles */
html{-webkit-tap-highlight-color:transparent;}
body{-webkit-tap-highlight-color:transparent;}

.legal-watermark{
  position:fixed;
  left:50%;bottom:18px;transform:translateX(-50%);
  z-index:1200;
  padding:0.55rem 0.9rem;
  border:1px solid rgba(21,101,192,0.16);
  border-radius:999px;
  background:rgba(255,255,255,0.92);
  box-shadow:0 10px 26px rgba(15,23,42,0.12);
  color:var(--blue2);
  font-size:0.7rem;
  font-weight:800;
  letter-spacing:0.03em;
  backdrop-filter:blur(8px);
  user-select:none;
}
@media(max-width:430px){
  .legal-watermark{
    width:calc(100% - 24px);
    text-align:center;
    bottom:10px;
  }
}

/* ===== MOBILE FRAME ===== */
.phone-frame{
  width:390px;height:100vh;max-height:844px;
  margin:0 auto;
  position:relative;overflow:hidden;
  background:var(--bg);
  display:flex;flex-direction:column;
}
@media(max-width:430px){.phone-frame{width:100%;max-height:100vh;}}
@supports (height: 100dvh){
  .phone-frame{height:100dvh;}
  @media(max-width:430px){.phone-frame{max-height:100dvh;}}
}
@media (prefers-reduced-motion: reduce){
  .screen{transition:none;}
  *,*::before,*::after{
    animation-duration:0.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:0.01ms !important;
    scroll-behavior:auto !important;
  }
}

/* ===== SCREENS ===== */
.screen{position:absolute;inset:0;display:flex;flex-direction:column;transition:opacity 0.3s cubic-bezier(0.4,0,0.2,1),transform 0.3s cubic-bezier(0.4,0,0.2,1);background:var(--bg);will-change:transform;contain:layout paint;backface-visibility:hidden;}
.screen.hidden{opacity:0;pointer-events:none;transform:translateX(30px);}
.screen.slide-left.hidden{transform:translateX(-30px);}
.screen.slide-up.hidden{transform:translateY(100%);}

.screen-back-btn{
  width:34px;height:34px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,0.92);color:var(--text);
  border:1px solid var(--border);font-size:1.15rem;font-weight:700;
  box-shadow:var(--shadow);z-index:25;
}
.map-back{position:absolute;top:12px;left:12px;}
.section-back{position:absolute;top:12px;left:12px;}

.map-canvas{
  position:absolute;inset:0;width:100%;height:100%;
  border:none;z-index:0;
}

.leaflet-container{width:100%;height:100%;background:var(--blue-light);}
.leaflet-top,.leaflet-bottom{z-index:12;}
.map-car-marker{font-size:1.25rem;line-height:1;filter:drop-shadow(0 2px 4px rgba(0,0,0,0.25));}

/* ===== STATUS BAR ===== */
.status-bar{
  height:44px;min-height:44px;
  display:flex;align-items:center;justify-content:space-between;
  padding:0 1.25rem;
  background:transparent;
  position:relative;z-index:10;
}
.status-time{font-size:0.82rem;font-weight:700;}
.status-icons{display:flex;gap:4px;align-items:center;font-size:0.7rem;}

/* ===== SPLASH ===== */
#screen-splash{
  background:linear-gradient(160deg,var(--blue2) 0%,var(--blue) 50%,var(--cyan) 100%);
  align-items:center;justify-content:center;gap:1rem;
}
.splash-logo{
  width:80px;height:80px;background:white;border-radius:24px;
  display:flex;align-items:center;justify-content:center;
  font-size:2.5rem;
  box-shadow:0 8px 32px rgba(0,0,0,0.2);
  animation:logo-bounce 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes logo-bounce{from{transform:scale(0.5);opacity:0;}to{transform:scale(1);opacity:1;}}
.splash-name{font-size:2.2rem;font-weight:800;color:white;letter-spacing:-0.03em;}
.splash-name span{opacity:0.8;}
.splash-sub{font-size:0.88rem;color:rgba(255,255,255,0.7);}
.splash-loader{width:48px;height:3px;background:rgba(255,255,255,0.3);border-radius:99px;margin-top:2rem;overflow:hidden;}
.splash-loader-bar{width:0%;height:100%;background:white;border-radius:99px;animation:load 2s ease forwards;}
@keyframes load{to{width:100%;}}

/* ===== LOGIN ===== */
#screen-login{background:white;}
.login-hero{
  height:220px;
  background:linear-gradient(160deg,var(--blue2),var(--blue),var(--cyan));
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;
  flex-shrink:0;
}
.login-hero-logo{font-size:2rem;background:white;width:56px;height:56px;border-radius:16px;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 16px rgba(0,0,0,0.2);}
.login-hero-title{font-size:1.5rem;font-weight:800;color:white;letter-spacing:-0.02em;}
.login-body{flex:1;padding:2rem 1.5rem;overflow-y:auto;}
.login-heading{font-size:1.3rem;font-weight:800;margin-bottom:0.3rem;}
.login-sub{font-size:0.83rem;color:var(--text3);margin-bottom:1.5rem;}
.form-group{margin-bottom:1rem;}
.form-label{display:block;font-size:0.72rem;font-weight:700;letter-spacing:0.05em;text-transform:uppercase;color:var(--text2);margin-bottom:0.4rem;}
.form-input{
  width:100%;padding:0.85rem 1rem;
  border:1.5px solid var(--border);border-radius:var(--radius-sm);
  font-size:0.9rem;color:var(--text);background:var(--surface);
  transition:all 0.2s;
}
.form-input:focus{border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-dim);}
.phone-input-wrap{display:flex;gap:0.5rem;}
.phone-prefix{
  padding:0.85rem 0.75rem;border:1.5px solid var(--border);
  border-radius:var(--radius-sm);background:var(--surface);
  font-size:0.9rem;font-weight:600;color:var(--text2);white-space:nowrap;
  display:flex;align-items:center;gap:4px;
}
.btn-blue{
  width:100%;padding:0.95rem;
  background:linear-gradient(135deg,var(--blue),var(--blue2));
  border-radius:var(--radius-sm);color:white;
  font-size:0.95rem;font-weight:700;
  box-shadow:0 4px 16px rgba(33,150,243,0.35);
  transition:all 0.2s;margin-top:0.5rem;
}
.btn-blue:active{transform:scale(0.98);}
.divider{display:flex;align-items:center;gap:1rem;margin:1.25rem 0;color:var(--text3);font-size:0.78rem;}
.divider::before,.divider::after{content:'';flex:1;height:1px;background:var(--border);}
.social-login{display:grid;grid-template-columns:1fr 1fr;gap:0.75rem;}
.social-btn{
  padding:0.75rem;border:1.5px solid var(--border);border-radius:var(--radius-sm);
  font-size:0.82rem;font-weight:600;display:flex;align-items:center;justify-content:center;gap:0.5rem;
  transition:all 0.15s;background:white;
}
.social-btn:active{background:var(--surface);}

/* ===== HOME / MAP ===== */
#screen-home{background:transparent;}
.map-full{
  position:absolute;inset:0;
  background:linear-gradient(170deg,#c8deff 0%,#d4e9f7 30%,#bdd6ee 60%,#a8c8e8 100%);
  overflow:hidden;
}
.map-svg-roads{position:absolute;inset:0;width:100%;height:100%;}
.map-car-icon{position:absolute;font-size:1.4rem;transition:all 2.5s ease;filter:drop-shadow(0 2px 4px rgba(0,0,0,0.2));}
.map-my-location{
  position:absolute;bottom:38%;left:50%;transform:translate(-50%,-50%);
  display:flex;flex-direction:column;align-items:center;
}
.my-loc-dot{
  width:20px;height:20px;border-radius:50%;
  background:var(--blue);border:3px solid white;
  box-shadow:0 0 0 8px rgba(33,150,243,0.2);
  animation:loc-pulse 2s infinite;
}
@keyframes loc-pulse{0%,100%{box-shadow:0 0 0 8px rgba(33,150,243,0.2);}50%{box-shadow:0 0 0 16px rgba(33,150,243,0.05);}}
.my-loc-shadow{width:16px;height:6px;background:rgba(0,0,0,0.1);border-radius:50%;margin-top:2px;}

/* Top bar on map */
.map-topbar{
  position:absolute;top:0;left:0;right:0;z-index:20;
  padding:48px 1rem 0.75rem;
  background:linear-gradient(180deg,rgba(255,255,255,0.95) 0%,rgba(255,255,255,0) 100%);
}
.map-topbar-inner{
  display:flex;align-items:center;gap:0.75rem;
  min-width:0;
}
.map-greeting{
  flex:1;
  min-width:0;
  background:white;border-radius:var(--radius);
  padding:0.65rem 1rem;
  box-shadow:var(--shadow);
  display:flex;align-items:center;gap:0.75rem;
  cursor:pointer;transition:all 0.15s;
  border:1.5px solid var(--border);
}
.map-greeting:active{transform:scale(0.98);}
.map-greeting-icon{font-size:1.1rem;}
.map-greeting-text{flex:1;min-width:0;}
.map-greeting-title{font-size:0.78rem;color:var(--text3);font-weight:500;}
.map-greeting-addr{font-size:0.9rem;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.avatar-sm{
  width:36px;height:36px;border-radius:50%;
  background:linear-gradient(135deg,var(--blue),var(--cyan));
  display:flex;align-items:center;justify-content:center;
  font-size:0.8rem;font-weight:700;color:white;flex-shrink:0;
  cursor:pointer;
}

/* Bottom drawer */
.bottom-drawer{
  position:absolute;bottom:0;left:0;right:0;z-index:20;
  background:white;border-radius:20px 20px 0 0;
  box-shadow:0 -4px 32px rgba(15,23,42,0.12);
  padding:0.5rem 1.25rem 2rem;
  transition:transform 0.35s cubic-bezier(0.4,0,0.2,1);
  touch-action:pan-y;
}
.drawer-handle{width:36px;height:4px;background:var(--border2);border-radius:99px;margin:0.5rem auto 1.25rem;}
.drawer-title{font-size:1.1rem;font-weight:800;margin-bottom:1rem;}

/* Where to input */
.where-to-btn{
  width:100%;padding:1rem 1.1rem;
  background:var(--surface);border:1.5px solid var(--border);border-radius:var(--radius-sm);
  display:flex;align-items:center;gap:0.75rem;text-align:left;
  transition:all 0.15s;
}
.where-to-btn:active{transform:scale(0.98);background:var(--blue-dim);}
.where-icon{font-size:1.1rem;}
.where-text{flex:1;}
.where-label{font-size:0.72rem;color:var(--text3);}
.where-placeholder{font-size:0.92rem;font-weight:600;color:var(--text2);}
.where-arrow{color:var(--text3);}

.location-refresh-btn{
  width:100%;
  padding:0.72rem 0.95rem;
  margin-bottom:0.75rem;
  border-radius:var(--radius-sm);
  border:1.5px solid rgba(21,101,192,0.22);
  background:linear-gradient(135deg,#eef6ff,#e3f2fd);
  color:var(--blue2);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0.45rem;
  font-size:0.8rem;
  font-weight:800;
  letter-spacing:0.01em;
  transition:all 0.15s;
  touch-action:manipulation;
}
.location-refresh-btn:active{
  transform:scale(0.98);
  background:var(--blue-dim);
}

/* Quick destinations */
.quick-dests{display:flex;gap:0.6rem;overflow-x:auto;padding:0.25rem 0;margin-bottom:0.75rem;}
.quick-dests::-webkit-scrollbar{display:none;}
.quick-chip{
  display:flex;align-items:center;gap:0.4rem;
  padding:0.55rem 0.85rem;
  background:var(--surface);border:1.5px solid var(--border);border-radius:99px;
  font-size:0.78rem;font-weight:600;white-space:nowrap;
  transition:all 0.15s;flex-shrink:0;
}
.quick-chip:active{background:var(--blue-dim);border-color:var(--blue);}

.promo-banner{
  margin:0.1rem 0 0.95rem;
  border-radius:14px;
  border:1px solid rgba(21,101,192,0.16);
  background:linear-gradient(135deg,#eef6ff,#e4f2ff);
  box-shadow:0 8px 18px rgba(15,23,42,0.08);
  display:flex;
  align-items:center;
  gap:0.75rem;
  padding:0.65rem;
}
.promo-banner-image{
  width:78px;
  height:78px;
  border-radius:10px;
  border:1px solid var(--border);
  object-fit:cover;
  background:white;
  flex-shrink:0;
}
.promo-banner-content{min-width:0;}
.promo-banner-tag{font-size:0.62rem;font-weight:800;letter-spacing:0.08em;text-transform:uppercase;color:var(--blue2);}
.promo-banner-title{font-size:0.83rem;font-weight:800;color:var(--text);line-height:1.25;margin-top:0.12rem;}
.promo-banner-sub{font-size:0.7rem;color:var(--text3);margin-top:0.2rem;line-height:1.3;}

/* Recent places */
.recent-place{
  display:flex;align-items:center;gap:0.85rem;
  padding:0.75rem 0;border-bottom:1px solid var(--border);
  cursor:pointer;transition:all 0.15s;
}
.recent-place:last-child{border-bottom:none;}
.recent-place:active{background:var(--surface);margin:0 -1.25rem;padding:0.75rem 1.25rem;}
.rp-icon{
  width:38px;height:38px;border-radius:50%;background:var(--blue-dim);
  display:flex;align-items:center;justify-content:center;font-size:1rem;flex-shrink:0;
}
.rp-info{flex:1;min-width:0;}
.rp-name{font-size:0.88rem;font-weight:700;}
.rp-addr{font-size:0.72rem;color:var(--text3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.rp-time{font-size:0.7rem;color:var(--text3);}

/* Bottom nav */
.bottom-nav{
  position:absolute;bottom:0;left:0;right:0;z-index:30;
  background:white;border-top:1px solid var(--border);
  display:flex;align-items:center;
  padding:0.5rem 0 1.5rem;
}
.bottom-nav.hidden{display:none;}
.nav-tab{
  flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;
  padding:0.4rem;cursor:pointer;transition:all 0.15s;
}
.nav-tab .n-ico{font-size:1.3rem;}
.nav-tab .n-lbl{font-size:0.65rem;font-weight:600;color:var(--text3);}
.nav-tab.active .n-lbl{color:var(--blue);}
.nav-tab.active .n-ico{filter:drop-shadow(0 2px 4px rgba(33,150,243,0.4));}
.nav-dot{width:4px;height:4px;border-radius:50%;background:var(--blue);margin:0 auto;opacity:0;}
.nav-tab.active .nav-dot{opacity:1;}

/* ===== SEARCH SCREEN ===== */
#screen-search{background:white;}
.search-header{
  padding:48px 1rem 0.75rem;
  border-bottom:1px solid var(--border);
}
.search-bar{
  display:flex;align-items:center;gap:0.75rem;
  background:var(--surface);border:1.5px solid var(--blue);
  border-radius:var(--radius-sm);padding:0.75rem 1rem;
  box-shadow:0 0 0 3px var(--blue-dim);
}
.search-bar input{flex:1;background:none;border:none;font-size:0.92rem;color:var(--text);}
.search-bar input::placeholder{color:var(--text3);}
.back-btn{font-size:1.2rem;background:none;padding:2px 4px;}
.search-points{padding:0 1rem 0.75rem;border-bottom:1px solid var(--border);}
.point-row{display:flex;align-items:center;gap:0.75rem;padding:0.65rem 0;}
.point-dot{width:12px;height:12px;border-radius:50%;flex-shrink:0;}
.point-dot.origin{background:var(--blue);}
.point-dot.dest{background:var(--red);}
.point-line{width:2px;height:16px;background:var(--border2);margin:0 5px;}
.point-input{flex:1;font-size:0.88rem;color:var(--text);border:none;background:none;padding:4px 0;font-weight:500;}
.point-input::placeholder{color:var(--text3);font-weight:400;}
.search-status{min-height:22px;padding:0.35rem 1rem 0;font-size:0.75rem;color:var(--text3);}
.suggestion-list{flex:1;overflow-y:auto;padding:0.5rem 0;}
.suggestion-item{
  display:flex;align-items:center;gap:0.85rem;
  padding:0.85rem 1rem;cursor:pointer;transition:all 0.15s;
}
.suggestion-item:active{background:var(--surface);}
.sug-icon{width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:1rem;flex-shrink:0;}
.sug-icon.map-icon{background:#e3f2fd;}
.sug-icon.hist-icon{background:var(--surface);}
.sug-info{flex:1;min-width:0;}
.sug-name{font-size:0.88rem;font-weight:600;}
.sug-addr{font-size:0.72rem;color:var(--text3);}
.sug-dist{font-size:0.72rem;color:var(--blue);font-weight:600;}

/* ===== CHOOSE RIDE SCREEN ===== */
#screen-choose{background:white;overflow:hidden;}
.choose-map-preview{
  height:200px;flex-shrink:0;
  background:linear-gradient(170deg,#c8deff,#bdd6ee);
  position:relative;overflow:hidden;
}
.route-line-svg{position:absolute;inset:0;width:100%;height:100%;}
.choose-body{flex:1;overflow-y:auto;padding:1.25rem;}
.choose-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;}
.choose-title{font-size:1.1rem;font-weight:800;}
.eta-badge{background:var(--green-dim);color:var(--green);padding:4px 10px;border-radius:99px;font-size:0.78rem;font-weight:700;}
.ride-option{
  border:2px solid var(--border);border-radius:var(--radius);
  padding:1rem;margin-bottom:0.75rem;cursor:pointer;transition:all 0.2s;
  display:flex;align-items:center;gap:1rem;
  position:relative;
}
.ride-option:active{transform:scale(0.98);}
.ride-option.selected{border-color:var(--blue);background:var(--blue-dim);box-shadow:0 0 0 1px var(--blue);}
.ride-option.popular::before{
  content:'MÁS POPULAR';
  position:absolute;top:-1px;right:12px;
  background:var(--blue);color:white;
  font-size:0.58rem;font-weight:800;letter-spacing:0.08em;
  padding:2px 8px;border-radius:0 0 6px 6px;
}
.ride-icon{font-size:2rem;width:50px;text-align:center;flex-shrink:0;}
.ride-info{flex:1;}
.ride-name{font-size:0.95rem;font-weight:700;}
.ride-desc{font-size:0.75rem;color:var(--text2);}
.ride-eta{font-size:0.72rem;color:var(--green);font-weight:600;margin-top:2px;}
.ride-price{text-align:right;}
.ride-price-val{font-size:1.1rem;font-weight:800;display:block;}
.ride-price-old{font-size:0.72rem;color:var(--text3);text-decoration:line-through;}

/* Payment method selector */
.pay-selector{
  display:flex;align-items:center;gap:0.75rem;
  background:var(--surface);border:1.5px solid var(--border);border-radius:var(--radius-sm);
  padding:0.75rem 1rem;margin-bottom:1rem;cursor:pointer;
  transition:all 0.15s;
}
.pay-selector:active{border-color:var(--blue);}
.pay-sel-icon{font-size:1.2rem;}
.pay-sel-text{flex:1;}
.pay-sel-label{font-size:0.7rem;color:var(--text3);}
.pay-sel-value{font-size:0.88rem;font-weight:700;}
.pay-sel-arrow{color:var(--text3);}

/* Confirm btn */
.confirm-btn{
  width:100%;padding:1rem;
  background:linear-gradient(135deg,var(--blue),var(--blue2));
  border-radius:var(--radius-sm);color:white;
  font-size:1rem;font-weight:700;
  box-shadow:0 4px 16px rgba(33,150,243,0.35);
  transition:all 0.2s;
}
.confirm-btn:active{transform:scale(0.98);}
.confirm-btn:disabled{opacity:0.55;cursor:not-allowed;transform:none;box-shadow:none;}

/* ===== SEARCHING DRIVER ===== */
#screen-searching{
  background:white;
  align-items:center;justify-content:center;
  gap:1.5rem;
  padding:2rem;
}
.searching-animation{
  width:140px;height:140px;position:relative;
  display:flex;align-items:center;justify-content:center;
}
.search-ring{
  position:absolute;border:2px solid var(--blue);border-radius:50%;
  opacity:0;animation:ring-expand 2.5s ease infinite;
}
.search-ring:nth-child(1){width:60px;height:60px;animation-delay:0s;}
.search-ring:nth-child(2){width:90px;height:90px;animation-delay:0.5s;}
.search-ring:nth-child(3){width:120px;height:120px;animation-delay:1s;}
.search-ring:nth-child(4){width:150px;height:150px;animation-delay:1.5s;}
@keyframes ring-expand{
  0%{transform:scale(0.5);opacity:0.8;}
  100%{transform:scale(1);opacity:0;}
}
.search-center{font-size:2.5rem;position:relative;z-index:1;}
.searching-title{font-size:1.2rem;font-weight:800;text-align:center;}
.searching-sub{font-size:0.85rem;color:var(--text2);text-align:center;}
.searching-dots{display:flex;gap:6px;justify-content:center;}
.dot-anim{width:8px;height:8px;border-radius:50%;background:var(--blue);animation:dot-bounce 1.4s infinite;}
.dot-anim:nth-child(2){animation-delay:0.2s;}
.dot-anim:nth-child(3){animation-delay:0.4s;}
@keyframes dot-bounce{0%,80%,100%{transform:scale(0.6);opacity:0.5;}40%{transform:scale(1);opacity:1;}}
.cancel-search-btn{
  padding:0.75rem 2rem;border:2px solid var(--border2);
  border-radius:99px;font-size:0.88rem;font-weight:700;color:var(--text2);
  transition:all 0.15s;
}
.cancel-search-btn:active{border-color:var(--red);color:var(--red);}

/* ===== DRIVER FOUND ===== */
#screen-driver-found{background:white;overflow-y:auto;}
.driver-found-map{
  height:220px;flex-shrink:0;
  background:linear-gradient(170deg,#c8deff,#bdd6ee);
  position:relative;overflow:hidden;
}
.df-eta-pill{
  position:absolute;top:1rem;left:50%;transform:translateX(-50%);
  background:white;border-radius:99px;padding:0.5rem 1.25rem;
  font-size:0.85rem;font-weight:700;box-shadow:var(--shadow);
  display:flex;align-items:center;gap:6px;
}
.df-car{position:absolute;font-size:1.8rem;bottom:40%;left:30%;animation:drive-in 1s ease forwards;}
@keyframes drive-in{from{left:-10%;}to{left:30%;}}
.df-body{padding:1.25rem;}
.df-header{display:flex;align-items:center;gap:1rem;margin-bottom:1.25rem;padding-bottom:1.25rem;border-bottom:1px solid var(--border);}
.df-avatar{
  width:60px;height:60px;border-radius:50%;
  background:linear-gradient(135deg,var(--blue),var(--cyan));
  display:flex;align-items:center;justify-content:center;
  font-size:1.4rem;font-weight:700;color:white;flex-shrink:0;
  box-shadow:0 4px 12px rgba(33,150,243,0.3);
}
.df-driver-name{font-size:1.1rem;font-weight:800;}
.df-rating{display:flex;align-items:center;gap:4px;font-size:0.82rem;color:var(--orange);font-weight:600;}
.df-trips{font-size:0.72rem;color:var(--text3);}
.df-car-info{margin-left:auto;text-align:right;}
.df-car-name{font-size:0.88rem;font-weight:700;}
.df-plate{font-size:0.78rem;color:var(--text3);font-family:'DM Mono',monospace;}
.df-car-color{font-size:0.72rem;color:var(--text2);}
.df-steps{display:flex;flex-direction:column;gap:0;margin-bottom:1.25rem;}
.df-step{display:flex;align-items:flex-start;gap:0.85rem;padding:0.5rem 0;}
.step-icon-wrap{display:flex;flex-direction:column;align-items:center;gap:2px;}
.step-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0;margin-top:4px;}
.step-dot.blue{background:var(--blue);}
.step-dot.red{background:var(--red);}
.step-connector{width:2px;height:20px;background:var(--border2);}
.step-text{flex:1;}
.step-label{font-size:0.7rem;font-weight:700;color:var(--text3);text-transform:uppercase;letter-spacing:0.04em;}
.step-value{font-size:0.88rem;font-weight:600;}
.df-actions{display:grid;grid-template-columns:1fr 1fr;gap:0.75rem;margin-bottom:1rem;}
.df-action{
  display:flex;flex-direction:column;align-items:center;gap:0.35rem;
  padding:0.85rem;border:1.5px solid var(--border);border-radius:var(--radius-sm);
  font-size:0.72rem;font-weight:700;color:var(--text2);
  transition:all 0.15s;
}
.df-action.has-badge{position:relative;overflow:visible;}
.df-action:active{border-color:var(--blue);color:var(--blue);background:var(--blue-dim);}
.df-action .act-icon{font-size:1.3rem;}
.action-badge{
  position:absolute;top:-8px;right:-8px;min-width:22px;height:22px;padding:0 6px;
  border-radius:999px;background:var(--red);color:white;display:none;
  align-items:center;justify-content:center;font-size:0.7rem;font-weight:800;
  box-shadow:0 6px 14px rgba(239,68,68,0.3);
}
.action-badge.visible{display:flex;}
.cancel-ride-btn{
  width:100%;padding:0.85rem;
  border:2px solid var(--border2);border-radius:var(--radius-sm);
  font-size:0.88rem;font-weight:700;color:var(--text3);
  transition:all 0.15s;
}
.cancel-ride-btn:active{border-color:var(--red);color:var(--red);}

/* Status bar on trip */
.trip-status-bar{
  background:linear-gradient(135deg,var(--blue),var(--blue2));
  padding:1rem 1.25rem;color:white;
  display:flex;align-items:center;gap:0.75rem;
  margin-bottom:1.25rem;border-radius:var(--radius);
}
.tsb-icon{font-size:1.4rem;}
.tsb-title{font-size:0.95rem;font-weight:700;}
.tsb-sub{font-size:0.75rem;opacity:0.85;}

/* ===== TRIP IN PROGRESS ===== */
#screen-trip{background:white;overflow-y:auto;}
.trip-progress-map{
  height:240px;flex-shrink:0;
  background:linear-gradient(170deg,#c8deff,#bdd6ee);
  position:relative;overflow:hidden;
}
.progress-car{position:absolute;font-size:1.8rem;bottom:40%;left:20%;animation:car-progress 4s ease-in-out infinite alternate;}
@keyframes car-progress{to{left:65%;}}
.progress-bar-outer{
  position:absolute;bottom:1rem;left:1rem;right:1rem;
  height:6px;background:rgba(255,255,255,0.5);border-radius:99px;overflow:hidden;
}
.progress-bar-inner{height:100%;background:white;border-radius:99px;width:35%;animation:progress-fill 8s linear forwards;}
@keyframes progress-fill{to{width:90%;}}
.trip-body{padding:1.25rem;}
.trip-stat-row{
  display:grid;grid-template-columns:repeat(3,1fr);gap:0.75rem;
  margin-bottom:1.25rem;
}
.trip-stat{
  background:var(--surface);border-radius:var(--radius-sm);
  padding:0.85rem;text-align:center;
}
.trip-stat-val{font-size:1.1rem;font-weight:800;display:block;}
.trip-stat-lbl{font-size:0.68rem;color:var(--text3);margin-top:2px;}
.safety-btn{
  width:100%;padding:0.85rem;
  background:var(--red-dim);border:1.5px solid rgba(239,68,68,0.3);
  border-radius:var(--radius-sm);color:var(--red);
  font-size:0.85rem;font-weight:700;
  display:flex;align-items:center;justify-content:center;gap:0.5rem;
  transition:all 0.15s;margin-bottom:0.75rem;
}

/* ===== ARRIVED / RATING ===== */
#screen-arrived{background:white;overflow-y:auto;}
.arrived-hero{
  background:linear-gradient(135deg,var(--green),#059669);
  padding:3rem 1.5rem 2rem;
  display:flex;flex-direction:column;align-items:center;gap:0.75rem;
  color:white;
}
.arrived-icon{font-size:3rem;animation:arrived-bounce 0.5s cubic-bezier(0.34,1.56,0.64,1) both;}
@keyframes arrived-bounce{from{transform:scale(0);opacity:0;}to{transform:scale(1);opacity:1;}}
.arrived-title{font-size:1.4rem;font-weight:800;}
.arrived-sub{font-size:0.85rem;opacity:0.9;}
.trip-summary{padding:1.25rem;}
.summary-row{
  display:flex;justify-content:space-between;align-items:center;
  padding:0.75rem 0;border-bottom:1px solid var(--border);
  font-size:0.88rem;
}
.summary-row:last-child{border:none;}
.summary-label{color:var(--text2);}
.summary-value{font-weight:700;}
.summary-total .summary-label{font-size:1rem;font-weight:700;}
.summary-total .summary-value{font-size:1.3rem;font-weight:800;color:var(--blue);}
.rating-section{padding:0 1.25rem 1.25rem;}
.rating-title{font-size:0.95rem;font-weight:700;margin-bottom:0.5rem;}
.rating-sub{font-size:0.78rem;color:var(--text2);margin-bottom:1.25rem;}
.stars-row{display:flex;gap:0.5rem;justify-content:center;margin-bottom:1.25rem;}
.star-btn{font-size:2.2rem;transition:all 0.15s;filter:grayscale(1);}
.star-btn.active{filter:grayscale(0);transform:scale(1.1);}
.tip-row{display:flex;gap:0.5rem;margin-bottom:1rem;flex-wrap:wrap;}
.tip-chip{
  padding:0.5rem 0.85rem;border:1.5px solid var(--border);border-radius:99px;
  font-size:0.78rem;font-weight:600;transition:all 0.15s;
}
.tip-chip.selected{background:var(--blue-dim);border-color:var(--blue);color:var(--blue);}
.rating-comment{
  width:100%;padding:0.85rem 1rem;
  border:1.5px solid var(--border);border-radius:var(--radius-sm);
  font-size:0.88rem;resize:none;height:80px;margin-bottom:1rem;
  transition:all 0.2s;
}
.rating-comment:focus{border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-dim);}

/* ===== PROFILE ===== */
#screen-profile{background:white;overflow-y:auto;}
.profile-hero{
  background:linear-gradient(160deg,var(--blue2),var(--blue));
  padding:3rem 1.5rem 2.5rem;
  display:flex;flex-direction:column;align-items:center;gap:0.75rem;
  color:white;
}
.profile-avatar-lg{
  width:80px;height:80px;border-radius:50%;
  background:white;display:flex;align-items:center;justify-content:center;
  font-size:2rem;font-weight:800;color:var(--blue);
  border:3px solid rgba(255,255,255,0.5);
  box-shadow:0 4px 16px rgba(0,0,0,0.2);
}
.profile-name-lg{font-size:1.3rem;font-weight:800;}
.profile-rating{font-size:0.85rem;opacity:0.9;}
.profile-body{padding:1.25rem;}
.menu-section{margin-bottom:1.5rem;}
.menu-section-label{font-size:0.72rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--text3);margin-bottom:0.5rem;}
.menu-item{
  display:flex;align-items:center;gap:0.85rem;
  padding:0.9rem 0;border-bottom:1px solid var(--border);
  cursor:pointer;transition:all 0.15s;
}
.menu-item:last-child{border-bottom:none;}
.menu-item:active{background:var(--surface);margin:0 -1.25rem;padding:0.9rem 1.25rem;}
.menu-icon{
  width:38px;height:38px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;font-size:1.1rem;
  flex-shrink:0;
}
.menu-text{flex:1;}
.menu-label{font-size:0.88rem;font-weight:600;}
.menu-sub{font-size:0.72rem;color:var(--text3);}
.menu-arrow{color:var(--text3);font-size:0.85rem;}
.menu-badge{
  padding:2px 8px;border-radius:99px;
  font-size:0.65rem;font-weight:700;
  background:var(--blue-dim);color:var(--blue);
}

/* ===== HISTORY ===== */
#screen-history{background:white;overflow-y:auto;}
.history-header{
  padding:44px 1.25rem 1rem;
  border-bottom:1px solid var(--border);
}
.history-header-title{font-size:1.2rem;font-weight:800;margin-bottom:0.75rem;}
.history-filter{display:flex;gap:0.5rem;overflow-x:auto;}
.history-filter::-webkit-scrollbar{display:none;}
.history-item{
  display:flex;align-items:center;gap:0.85rem;
  padding:1rem 1.25rem;border-bottom:1px solid var(--border);
  cursor:pointer;transition:all 0.15s;
}
.history-item:active{background:var(--surface);}
.hi-icon{
  width:42px;height:42px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;font-size:1.1rem;
  flex-shrink:0;
}
.hi-info{flex:1;}
.hi-dest{font-size:0.88rem;font-weight:700;}
.hi-meta{font-size:0.72rem;color:var(--text3);}
.hi-right{text-align:right;}
.hi-price{font-size:0.88rem;font-weight:700;}
.hi-status{font-size:0.7rem;margin-top:2px;}

/* ===== PAYMENT METHODS ===== */
#screen-payments{background:white;overflow-y:auto;}
.pay-header{padding:44px 1.25rem 1rem;border-bottom:1px solid var(--border);}
.pay-header-title{font-size:1.2rem;font-weight:800;}
.payment-card{
  display:flex;align-items:center;gap:1rem;
  padding:1rem 1.25rem;border-bottom:1px solid var(--border);
}
.pc-logo{
  width:48px;height:32px;border-radius:6px;
  display:flex;align-items:center;justify-content:center;font-size:1.2rem;
  border:1px solid var(--border);background:white;flex-shrink:0;
}
.pc-info{flex:1;}
.pc-name{font-size:0.88rem;font-weight:700;}
.pc-detail{font-size:0.72rem;color:var(--text3);}
.pc-default{padding:2px 8px;background:var(--blue-dim);color:var(--blue);border-radius:99px;font-size:0.65rem;font-weight:700;}
.add-payment{
  display:flex;align-items:center;gap:0.85rem;
  padding:1rem 1.25rem;cursor:pointer;color:var(--blue);font-size:0.88rem;font-weight:700;
}

/* ===== PROMO ===== */
#screen-promo{background:white;overflow-y:auto;}
.promo-header{padding:44px 1.25rem 1rem;border-bottom:1px solid var(--border);}
.promo-header-title{font-size:1.2rem;font-weight:800;}
.promo-input-row{
  display:flex;gap:0.75rem;
  padding:1rem 1.25rem;border-bottom:1px solid var(--border);
}
.promo-input{flex:1;padding:0.75rem 1rem;border:1.5px solid var(--border);border-radius:var(--radius-sm);font-size:0.9rem;text-transform:uppercase;letter-spacing:0.05em;}
.apply-btn{
  padding:0.75rem 1.25rem;background:var(--blue);color:white;
  border-radius:var(--radius-sm);font-size:0.85rem;font-weight:700;
}
.promo-card{
  margin:1rem 1.25rem;
  background:linear-gradient(135deg,var(--blue),var(--blue2));
  border-radius:var(--radius);padding:1.25rem;color:white;
  position:relative;overflow:hidden;
}
.promo-card::after{
  content:'%';position:absolute;right:-10px;top:-20px;
  font-size:8rem;font-weight:900;opacity:0.08;line-height:1;
}
.promo-pct{font-size:2rem;font-weight:800;}
.promo-desc{font-size:0.85rem;opacity:0.9;margin-top:0.25rem;}
.promo-code-badge{
  display:inline-block;background:rgba(255,255,255,0.2);
  padding:3px 10px;border-radius:99px;font-family:'DM Mono',monospace;
  font-size:0.78rem;margin-top:0.5rem;letter-spacing:0.1em;
}
.promo-expiry{font-size:0.7rem;opacity:0.7;margin-top:0.5rem;}

/* ===== TOAST ===== */
.toast{
  position:fixed;bottom:100px;left:50%;transform:translateX(-50%);
  background:rgba(15,23,42,0.92);color:white;
  padding:0.75rem 1.5rem;border-radius:99px;
  font-size:0.82rem;font-weight:600;
  white-space:nowrap;z-index:9999;
  animation:toast-in 0.3s ease;
}
@keyframes toast-in{from{opacity:0;transform:translateX(-50%) translateY(10px);}to{opacity:1;transform:translateX(-50%) translateY(0);}}

/* ===== MODAL OVERLAY ===== */
.modal-overlay{
  position:fixed;inset:0;z-index:999;
  background:rgba(0,0,0,0.5);backdrop-filter:blur(4px);
  display:none;align-items:flex-end;justify-content:center;
}
.modal-overlay.open{display:flex;}
.modal-sheet{
  background:white;border-radius:20px 20px 0 0;
  width:100%;max-width:390px;
  padding:0.5rem 1.5rem 2.5rem;
  animation:sheet-up 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-y:contain;
  max-height:90vh;
}
@keyframes sheet-up{from{transform:translateY(100%);}to{transform:translateY(0);}}
.sheet-handle{width:36px;height:4px;background:var(--border2);border-radius:99px;margin:0.5rem auto 1.25rem;}
.sheet-title{font-size:1.05rem;font-weight:800;margin-bottom:1.25rem;}
.pay-method-option{
  display:flex;align-items:center;gap:1rem;
  padding:0.85rem;border-radius:var(--radius-sm);cursor:pointer;
  transition:all 0.15s;border:2px solid transparent;
  margin-bottom:0.5rem;
}
.pay-method-option:active{background:var(--surface);}
.pay-method-option.selected{border-color:var(--blue);background:var(--blue-dim);}
.pmo-icon{width:44px;height:30px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:1.2rem;border:1px solid var(--border);}
.pmo-name{font-size:0.88rem;font-weight:700;flex:1;}
.pmo-check{color:var(--blue);font-weight:800;opacity:0;}
.pay-method-option.selected .pmo-check{opacity:1;}

.chat-sheet{padding-bottom:1.25rem;display:flex;flex-direction:column;gap:0.85rem;min-height:64vh;max-height:78vh;}
.chat-sheet-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;}
.chat-peer-subtitle{font-size:0.78rem;color:var(--text3);}
.chat-close-btn{width:34px;height:34px;border-radius:50%;border:1px solid var(--border);background:var(--surface);font-size:0.95rem;font-weight:700;color:var(--text2);}
.chat-message-list{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:0.75rem;padding-right:0.15rem;min-height:220px;max-height:42vh;-webkit-overflow-scrolling:touch;overscroll-behavior-y:contain;}
.chat-empty-state{font-size:0.82rem;line-height:1.45;color:var(--text3);background:var(--surface);border:1px dashed var(--border2);border-radius:var(--radius-sm);padding:0.95rem;}
.chat-empty-state.hidden{display:none;}
.chat-bubble{max-width:82%;padding:0.8rem 0.9rem;border-radius:16px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:0.3rem;}
.chat-bubble.mine{align-self:flex-end;background:linear-gradient(135deg,var(--blue),var(--blue2));color:white;border-bottom-right-radius:6px;}
.chat-bubble.theirs{align-self:flex-start;background:var(--surface);color:var(--text);border:1px solid var(--border);border-bottom-left-radius:6px;}
.chat-author{font-size:0.68rem;font-weight:800;letter-spacing:0.04em;text-transform:uppercase;opacity:0.72;}
.chat-text{font-size:0.88rem;line-height:1.45;white-space:pre-wrap;word-break:break-word;}
.chat-time{font-size:0.68rem;opacity:0.7;align-self:flex-end;}
.chat-compose{display:flex;gap:0.75rem;align-items:flex-end;}
.chat-input{flex:1;min-height:54px;max-height:120px;padding:0.85rem 1rem;border:1.5px solid var(--border);border-radius:16px;background:var(--surface);font-size:0.9rem;resize:none;transition:all 0.2s;}
.chat-input:focus{border-color:var(--blue);box-shadow:0 0 0 3px var(--blue-dim);}
.chat-send-btn{padding:0.95rem 1rem;border-radius:16px;background:linear-gradient(135deg,var(--blue),var(--blue2));color:white;font-size:0.85rem;font-weight:800;box-shadow:0 8px 18px rgba(33,150,243,0.25);}

.peer-profile-sheet{display:flex;flex-direction:column;gap:0.95rem;max-height:82vh;padding-bottom:1.5rem;}
.peer-profile-head{display:flex;align-items:center;gap:0.85rem;}
.peer-profile-avatar{width:54px;height:54px;border-radius:50%;background:linear-gradient(135deg,var(--blue),var(--blue2));color:white;display:flex;align-items:center;justify-content:center;font-size:1.1rem;font-weight:800;flex-shrink:0;}
.peer-profile-meta{font-size:0.82rem;color:var(--text2);font-weight:600;}
.peer-stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:0.65rem;}
.peer-stat-item{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:0.75rem 0.65rem;}
.peer-stat-label{font-size:0.66rem;color:var(--text3);text-transform:uppercase;letter-spacing:0.04em;font-weight:700;}
.peer-stat-value{font-size:0.96rem;color:var(--text);font-weight:800;margin-top:0.2rem;}
.peer-comments-block{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:0.85rem;}
.peer-comments-title{font-size:0.8rem;font-weight:800;color:var(--text2);margin-bottom:0.55rem;}
.peer-comments-list{display:flex;flex-direction:column;gap:0.45rem;max-height:30vh;overflow-y:auto;padding-right:0.1rem;}
.peer-comment-item{font-size:0.8rem;line-height:1.4;color:var(--text2);padding:0.55rem 0.65rem;background:white;border:1px solid var(--border);border-radius:11px;}

/* ===== UTILIDADES Y CHIPS ===== */
#toast-container{position:fixed;bottom:110px;left:50%;transform:translateX(-50%);z-index:9999;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;}
@keyframes ride-route{from{left:5%;top:55%;}to{left:85%;top:20%;}}
.chip{padding:5px 12px;border-radius:99px;font-size:0.72rem;font-weight:600;border:1.5px solid var(--border2);color:var(--text2);background:white;cursor:pointer;transition:all 0.15s;white-space:nowrap;}
.chip.active{background:var(--blue-dim);border-color:var(--blue);color:var(--blue);}

#screen-arrived .section-back,
#screen-history .section-back,
#screen-profile .section-back{
  top:52px;
}