:root{
  --bg:#07071c;
  --panel:#15162d;
  --panel2:#20213c;
  --text:#fff;
  --muted:#b9bdd3;
  --line:rgba(255,255,255,.12);
  --green:#00ff9d;
  --cyan:#00cfff;
  --purple:#7b2eff;
  --danger:#ff5f6d;
}

*{box-sizing:border-box}

body{
  margin:0;
  min-height:100vh;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at top left, rgba(0,255,157,.13), transparent 26rem),
    radial-gradient(circle at top right, rgba(123,46,255,.18), transparent 28rem),
    linear-gradient(135deg,#050514,#101033);
}

a{color:inherit}

.shell,
.driver-app{
  width:min(1180px, calc(100% - 32px));
  margin:0 auto;
  padding:32px 0 56px;
}

.hero,
.driver-card{
  background:rgba(21,22,45,.88);
  border:1px solid var(--line);
  border-radius:28px;
  padding:28px;
  box-shadow:0 24px 70px rgba(0,0,0,.28);
  backdrop-filter:blur(14px);
}

.hero{
  min-height:calc(100vh - 64px);
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-start;
}

.hero h1,
.driver-topbar h1{
  margin:0;
  font-size:clamp(2rem,5vw,4rem);
  letter-spacing:-.05em;
  line-height:1;
}

.hero p,
.muted{
  color:var(--muted);
  line-height:1.6;
}

.eyebrow{
  margin:0 0 10px;
  color:var(--green);
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:.78rem;
}

.actions,
.driver-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:20px;
}

.actions a,
.driver-topbar a,
button,
.driver-btn{
  border:0;
  border-radius:999px;
  padding:12px 18px;
  font-weight:900;
  text-decoration:none;
  cursor:pointer;
  background:linear-gradient(135deg,var(--green),var(--cyan),var(--purple));
  color:#07101c;
}

.actions a.secondary,
.driver-topbar a.secondary,
button.secondary,
.driver-btn.secondary{
  background:rgba(255,255,255,.08);
  color:#fff;
  border:1px solid var(--line);
}

.driver-form-card{
  width:min(560px,100%);
  margin:0 auto;
}

.driver-form{
  display:grid;
  gap:14px;
  margin-top:20px;
}

label{
  display:grid;
  gap:7px;
  color:var(--muted);
  font-weight:800;
}

input,select,textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:16px;
  padding:13px 14px;
  background:rgba(255,255,255,.08);
  color:#fff;
  outline:none;
  font:inherit;
}

input:focus,select:focus,textarea:focus{
  border-color:var(--green);
  box-shadow:0 0 0 4px rgba(0,255,157,.12);
}

.form-row,
.driver-grid,
.profile-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:14px;
}

.alert{
  margin:16px 0;
  padding:14px 16px;
  border-radius:16px;
  border:1px solid var(--line);
}

.alert.error{
  border-color:rgba(255,95,109,.35);
  background:rgba(255,95,109,.12);
}

.alert.success{
  border-color:rgba(0,255,157,.35);
  background:rgba(0,255,157,.12);
}

.driver-topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  margin-bottom:22px;
}

.driver-nav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:20px;
}

.driver-nav a{
  padding:10px 14px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid var(--line);
  text-decoration:none;
  color:var(--muted);
  font-weight:900;
}

.driver-nav a.is-active{
  color:#07101c;
  background:linear-gradient(135deg,var(--green),var(--cyan));
}

.driver-order-list{
  display:grid;
  gap:16px;
}

.driver-card header{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:18px;
}

.driver-card header strong{
  font-size:1.25rem;
}

.driver-card header span,
.driver-grid span,
.profile-grid span{
  display:block;
  color:var(--muted);
  margin-top:4px;
}

.driver-card em,
.status-pill{
  font-style:normal;
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(0,255,157,.12);
  border:1px solid rgba(0,255,157,.24);
  color:var(--green);
  font-weight:900;
}

.driver-address{
  margin-top:16px;
  padding:16px;
  border-radius:18px;
  background:rgba(255,255,255,.05);
  border:1px solid var(--line);
}

.driver-address p{
  color:var(--muted);
  margin-bottom:0;
}

.driver-actions form{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.driver-actions input{
  max-width:160px;
}

.code-box{
  margin-top:14px;
  padding:16px;
  border-radius:18px;
  background:linear-gradient(135deg,rgba(0,207,255,.12),rgba(123,46,255,.14));
  border:1px solid rgba(255,255,255,.14);
  text-align:center;
}

.code-box strong{
  display:block;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:1.8rem;
  letter-spacing:.14em;
}

@media(max-width:700px){
  .driver-topbar{
    align-items:flex-start;
    flex-direction:column;
  }
  .hero,.driver-card{
    padding:22px;
    border-radius:22px;
  }
}

/* Customer-style auth screen for driver portal */
.vk-auth-body{
  min-height:100vh;
  margin:0;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:
    radial-gradient(circle at top left, rgba(0,255,157,.16), transparent 24rem),
    radial-gradient(circle at top right, rgba(123,46,255,.22), transparent 28rem),
    linear-gradient(135deg,#050514,#101033);
  color:#fff;
}

.vk-auth-shell{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:28px 18px;
}

.vk-auth-card{
  width:min(480px,100%);
  padding:34px 28px;
  border-radius:32px;
  background:rgba(18,20,43,.88);
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 28px 80px rgba(0,0,0,.35);
  backdrop-filter:blur(16px);
  text-align:center;
}

.vk-auth-logo{
  display:inline-flex;
  justify-content:center;
  margin-bottom:18px;
}

.vk-auth-logo img{
  width:180px;
  max-width:80%;
  height:auto;
  display:block;
}

.vk-results-eyebrow{
  color:#00ff9d;
  font-size:.78rem;
  font-weight:900;
  letter-spacing:.14em;
  text-transform:uppercase;
  margin:0 0 8px;
}

.vk-auth-card h1{
  margin:0;
  font-size:clamp(2rem,5vw,3.2rem);
  letter-spacing:-.05em;
  line-height:1;
}

.vk-auth-subtitle{
  color:#b9bdd3;
  margin:12px 0 22px;
}

.vk-auth-alert{
  padding:13px 15px;
  border-radius:16px;
  margin:0 0 18px;
  text-align:left;
  font-weight:700;
}

.vk-auth-alert--error{
  background:rgba(255,95,109,.13);
  border:1px solid rgba(255,95,109,.32);
  color:#ffd6dc;
}

.vk-auth-form{
  display:grid;
  gap:15px;
  text-align:left;
}

.vk-auth-form label{
  display:grid;
  gap:8px;
}

.vk-auth-form label span{
  color:#d9d6f5;
  font-weight:800;
  font-size:.92rem;
}

.vk-auth-form input{
  width:100%;
  border:1px solid rgba(255,255,255,.14);
  border-radius:18px;
  padding:14px 15px;
  background:rgba(255,255,255,.08);
  color:#fff;
  font:inherit;
  outline:none;
}

.vk-auth-form input:focus{
  border-color:#00ff9d;
  box-shadow:0 0 0 4px rgba(0,255,157,.12);
}

.button,
.button--pill{
  border:0;
  text-decoration:none;
  display:inline-flex;
  justify-content:center;
  align-items:center;
  border-radius:999px;
  padding:14px 20px;
  font-weight:900;
  cursor:pointer;
}

.button--lime{
  background:linear-gradient(135deg,#00ff9d,#00cfff,#7b2eff);
  color:#061018;
}

.vk-auth-footer{
  color:#b9bdd3;
  margin:18px 0 0;
  font-size:.95rem;
}

.vk-auth-footer a{
  color:#00ff9d;
  font-weight:900;
  text-decoration:none;
}

/* =========================
   Open Delivery Pool UX
========================= */
.driver-tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:18px 0;
}

.driver-tab{
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.07);
  color:#fff;
  padding:10px 14px;
  border-radius:999px;
  font-weight:900;
  cursor:pointer;
}

.driver-tab.is-active{
  background:linear-gradient(135deg,#00ff9d,#00cfff,#7b2eff);
  color:#061018;
}

.driver-panel{
  display:none;
}

.driver-panel.is-active{
  display:block;
}

.delivery-pool-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:16px;
}

.delivery-card{
  position:relative;
  overflow:hidden;
}

.delivery-card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at top right, rgba(0,255,157,.12), transparent 12rem),
    radial-gradient(circle at bottom left, rgba(123,46,255,.14), transparent 14rem);
}

.delivery-card > *{
  position:relative;
  z-index:1;
}

.delivery-card__top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:14px;
}

.delivery-card__order{
  font-size:1.3rem;
  font-weight:1000;
}

.delivery-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 11px;
  border-radius:999px;
  font-weight:900;
  font-size:.78rem;
  background:rgba(0,255,157,.12);
  border:1px solid rgba(0,255,157,.28);
  color:#00ff9d;
  white-space:nowrap;
}

.delivery-chip.purple{
  background:rgba(123,46,255,.14);
  border-color:rgba(123,46,255,.34);
  color:#d8c7ff;
}

.delivery-route{
  display:grid;
  gap:10px;
  margin:14px 0;
}

.delivery-stop{
  padding:14px;
  border-radius:18px;
  background:rgba(255,255,255,.055);
  border:1px solid rgba(255,255,255,.10);
}

.delivery-stop span{
  display:block;
  color:#b9bdd3;
  font-size:.8rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-bottom:4px;
}

.delivery-stop strong{
  display:block;
  color:#fff;
  margin-bottom:4px;
}

.delivery-stop p{
  color:#d9ddf5;
  margin:0;
  line-height:1.45;
}

.delivery-meta{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  margin:14px 0;
}

.delivery-meta div{
  padding:12px;
  border-radius:16px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
}

.delivery-meta span{
  display:block;
  color:#b9bdd3;
  font-size:.76rem;
  margin-bottom:4px;
}

.delivery-meta strong{
  font-size:1rem;
}

.delivery-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
}

.delivery-actions form{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.delivery-actions input{
  width:120px;
}

.location-status{
  margin:0 0 18px;
  padding:12px 14px;
  border-radius:18px;
  color:#dcecff;
  background:rgba(0,207,255,.08);
  border:1px solid rgba(0,207,255,.22);
}

.pickup-code{
  text-align:center;
  padding:16px;
  border-radius:18px;
  background:linear-gradient(135deg,rgba(0,255,157,.12),rgba(0,207,255,.12));
  border:1px dashed rgba(0,255,157,.4);
  margin:14px 0;
}

.pickup-code span{
  display:block;
  color:#b9bdd3;
  font-weight:900;
  font-size:.8rem;
  text-transform:uppercase;
  letter-spacing:.1em;
}

.pickup-code strong{
  display:block;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:1.8rem;
  letter-spacing:.16em;
  color:#00ff9d;
  margin-top:6px;
}

@media(max-width:700px){
  .delivery-meta{
    grid-template-columns:1fr;
  }
}

/* ETA + Delivered action row */
.delivery-actions{
  align-items:center;
}

.delivery-actions form{
  margin:0;
}

.delivery-actions select[name="eta_minutes"]{
  width:150px;
  min-width:150px;
  max-width:150px;
}

.delivery-actions form:has(select[name="eta_minutes"]){
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:10px;
}

.delivery-actions form:has(select[name="eta_minutes"]) button{
  white-space:nowrap;
}

@media(max-width:700px){
  .delivery-actions{
    align-items:stretch;
  }

  .delivery-actions select[name="eta_minutes"]{
    width:130px;
    min-width:130px;
  }
}

/* Driver wayfinding links */
.driver-map-link{
  color:#00ff9d;
  font-weight:900;
  text-decoration:none;
  display:inline-flex;
  gap:6px;
  align-items:flex-start;
  line-height:1.35;
}

.driver-map-link:hover{
  color:#00cfff;
  text-decoration:underline;
}

/* =========================
   Driver Dashboard
========================= */

.driver-stats-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
  margin-bottom:20px;
}

.driver-stat-card{
  padding:20px;
  border-radius:24px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
}

.driver-stat-card span{
  display:block;
  color:#b9bdd3;
  margin-bottom:8px;
  font-size:.85rem;
}

.driver-stat-card strong{
  font-size:2rem;
  line-height:1;
}

.driver-chart-wrap{
  height:320px;
  margin-top:20px;
}

.driver-two-col{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
  gap:18px;
  margin-top:18px;
}

.driver-history-list{
  display:grid;
  gap:12px;
  margin-top:16px;
}

.driver-history-row{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  padding:14px;
  border-radius:18px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
}

.driver-history-row strong{
  display:block;
}

.driver-history-row span{
  display:block;
  color:#b9bdd3;
  margin-top:4px;
}

.driver-history-row small{
  color:#9ea6d5;
}
