/* Almaty Taxi · address form polish and direction selector · 2026-11-01
   Design-only changes. Both main page and Telegram Mini App use this sheet. */

/* Legible, equally sized direction buttons without letter medallions. */
.direction-tabs {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  align-items:stretch;
}
.direction-tab {
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  min-height:60px;
  padding:12px 15px;
  gap:0;
  border-radius:10px;
  text-align:center;
  line-height:1.3;
  font-family:var(--almaty-font,'Onest',system-ui,sans-serif);
  font-size:17px;
  font-weight:750;
  letter-spacing:-.012em;
  overflow-wrap:normal;
}
.direction-tab > .direction-caption { min-width:0; display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:0 2px; text-wrap:balance; }
.direction-tab b { font-size:20px; font-weight:800; padding:0 5px; white-space:nowrap; }
.direction-tab.selected { border-width:2px; }
.telegram-miniapp .direction-tab { font-size:17px; gap:0; padding:12px 15px; }

/* The Almaty district field and the fixed Qonaev city field occupy exactly
   the same first-row space, so street and house fields align horizontally. */
.fields.two > .address-flow-group { min-width:0; }
.address-flow-group { gap:0; }
.address-district-row, .address-city-row {
  box-sizing:border-box;
  display:grid;
  grid-template-rows:20px 50px;
  gap:8px;
  min-width:0;
  margin:8px 0 12px;
}
.address-district-row[hidden], .address-city-row[hidden] { display:none!important; }
.address-district-row > label, .address-city-label,
.address-house-row > label {
  display:block;
  font-family:var(--almaty-font,'Onest',system-ui,sans-serif);
  font-size:13px;
  line-height:20px;
  font-weight:700;
  color:#345249;
}
.address-district-select, .address-city-value {
  box-sizing:border-box;
  display:flex;
  align-items:center;
  width:100%;
  height:50px;
  min-height:50px;
  border:1px solid #cfded6;
  border-radius:9px;
  padding:0 14px;
  background:#f8fbf9;
  color:#21483d;
  font-family:var(--almaty-font,'Onest',system-ui,sans-serif);
  font-size:16px;
  font-weight:650;
  line-height:1.3;
  -webkit-text-fill-color:#21483d;
}
.address-district-select { cursor:pointer; -webkit-appearance:auto; appearance:auto; }
.address-district-select:focus { border-color:#4f9681; outline:2px solid #b6dfca; outline-offset:1px; }
.address-city-value { background:#edf4f0; border-color:#dbe7df; }

/* Reserve consistent room for street labels and guidance in each column.
   Long hints can still wrap without overlapping the house row. */
.address-flow-group > .field {
  width:100%;
  min-width:0;
  min-height:118px;
  justify-content:flex-start;
}
.address-flow-group > .field > span:first-child {
  line-height:20px;
  min-height:20px;
}
.address-flow-group > .field .input-wrap input {
  color:#1d4035;
  -webkit-text-fill-color:#1d4035;
  background:#f9fcfa;
}
.address-flow-group > .field .field-sub {
  display:block;
  line-height:1.45;
  color:#6c8277;
}
.address-house-row {
  display:flex;
  flex-direction:column;
  min-width:0;
  margin:0 0 10px;
  gap:7px;
}
.address-house-row .input-wrap { min-width:0; width:100%; }
.address-house-row .input-wrap input,
.address-house-row .input-wrap input.address-selected {
  box-sizing:border-box;
  width:100%;
  height:50px;
  min-height:50px;
  padding:0 14px;
  border:1px solid #cfded6;
  border-radius:9px;
  background:#f8fbf9;
  color:#153a2e;
  -webkit-text-fill-color:#153a2e;
  opacity:1;
  font-family:var(--almaty-font,'Onest',system-ui,sans-serif);
  font-size:17px;
  font-weight:750;
  font-variant-numeric:tabular-nums;
  line-height:1.3;
  caret-color:#135b48;
  transition:border-color .15s,box-shadow .15s;
}
.address-house-row .input-wrap input::placeholder {
  color:#82968b;
  -webkit-text-fill-color:#82968b;
  font-size:14px;
  font-weight:500;
  opacity:1;
}
.address-house-row .input-wrap input:disabled {
  background:#f2f5f3;
  color:#61796d;
  -webkit-text-fill-color:#61796d;
  border-color:#e1e9e4;
  cursor:not-allowed;
  opacity:1;
}
.address-house-row .input-wrap input:focus { background:#fff; border-color:#4f9681; outline:2px solid #cce7dc; outline-offset:1px; }
.address-house-row .input-wrap input.address-selected {
  background:#eef9f2;
  border-color:#4a9c79!important;
  box-shadow:0 0 0 1px rgba(67,151,111,.18);
}
/* The house suggestions were dark with inherited dark text: correct contrast. */
.address-house-row .address-results,
.address-house-row .address-results:not([hidden]) {
  background:#fff;
  color:#1d4035;
  border:1px solid #d0e0d6;
  border-radius:10px;
  box-shadow:0 16px 34px rgba(14,64,42,.18);
}
.address-house-row .address-results button {
  background:#fff;
  color:#1d4035;
  -webkit-text-fill-color:#1d4035;
  text-align:left;
  font-size:14px;
  line-height:1.45;
  font-weight:650;
}
.address-house-row .address-results button:hover,
.address-house-row .address-results button:focus-visible { background:#eaf5ed; color:#124a35; }
.address-house-row .address-option-note { color:#567569; opacity:1; }
.address-house-row .address-status { color:#576f62; }
.address-map-fallback { color:#17644c!important; border-top:1px solid #e4eee6!important; }

/* Mobile-first controls: 16px inputs prevent the iOS focus zoom. */
@media(max-width:970px) {
  .direction-tab { font-size:16px; }
}
@media(max-width:700px) {
  .direction-tabs { gap:8px; }
  .direction-tab { min-height:62px; font-size:15px; padding:10px 7px; border-radius:9px; }
  .direction-tab b { font-size:17px; padding:0 3px; }
  .telegram-miniapp .direction-tab { font-size:15px; padding:10px 7px; }
  /* Identical two-line label composition on narrow screens. */
  .direction-tab > .direction-caption {
    display:grid;
    grid-template-columns:auto auto;
    grid-template-rows:auto auto;
    justify-content:center;
    justify-items:center;
    column-gap:3px;
    row-gap:1px;
  }
  .direction-origin { grid-row:1; grid-column:1; }
  .direction-arrow { grid-row:1; grid-column:2; }
  .direction-destination { grid-row:2; grid-column:1 / -1; }
  .address-flow-group > .field { min-height:0; }
  .address-district-row,.address-city-row { margin:8px 0 12px; }
  .address-house-row .input-wrap input, .address-district-select, .address-city-value { font-size:16px; }
}
@media(max-width:380px) {
  .direction-tab { font-size:14px; line-height:1.35; padding:9px 5px; }
  .direction-tab b { font-size:16px; padding:0 2px; }
  .telegram-miniapp .direction-tab { font-size:14px; padding:9px 5px; }
}

/* Explicitly distinguish a manually pinned number from a verified building. */
.address-house-row .input-wrap input.address-map-selected {
  background:#fff8e9; color:#62451b; -webkit-text-fill-color:#62451b;
  border:1.5px solid #cfa65d; font-weight:750;
}
.address-nearby-warning {background:#fff8ea; color:#684e26!important; font-weight:650; border-bottom:1px solid #ecdcbc;}
.address-results button.address-map-fallback {background:#e8f6ed; color:#14583e!important; font-weight:750;}

/* V4.9: distinguish prefix matches from exact building addresses. */
.address-option-alternative .address-option-note{color:#93632c!important}
.address-nearby-warning{color:#7f4c19;font-weight:650}
