/* ============================================================
   eGumball rank search - v2
   Matches the mockup: separately bordered fields, blue magnifier,
   orange pin, arrow button, trust row underneath.
   Everything is scoped under .egs-* so nothing leaks into the
   Skeleton grid or the rest of layout.css.
   ============================================================ */

/* scoped reset - cannot leak outside the component */
.egs-band,
.egs-band *,
.egs-band *::before,
.egs-band *::after{ box-sizing: border-box; }

.egs-band{
    background: #fff;
    padding: 22px 0 26px;
    margin-bottom: 30px;
}
.egs-wrap{
    /* 972 - 32px of padding = 940px of content, which is exactly the width of
       .sixteen.columns, so the card lines up with the rest of the page. */
    max-width: 972px;
    margin: 0 auto;
    /* With viewport-fit=cover the page paints under the Dynamic Island, so in
       landscape the gutter grows to whatever iOS reports. env() is 0 on every
       other device, so max() keeps the normal 16px. */
    padding-left:  max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* screen-reader-only label */
.egs-sr{
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.egs{ margin: 0; }

/* ---------- the white card ---------- */
.egs-card{
    display: flex;
    align-items: stretch;
    gap: 12px;
    background: #fff;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(16,24,40,.06), 0 12px 32px rgba(16,24,40,.10);
    padding: 14px;
}

/* ---------- each field is its own bordered box ---------- */
.egs-field{
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 13px;
    height: 58px;
    padding: 0 18px;
    border: 1.5px solid #e3e8ef;
    border-radius: 12px;
    background: #fff;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.egs-field:focus-within{
    border-color: #ff5a00;
    box-shadow: 0 0 0 3px rgba(255,90,0,.14);
}

.egs-field svg{
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
}
/* blue magnifier, drawn as strokes. The selectors carry the element type so
   they beat any leftover ".egs-field svg" rule from an older copy of this file. */
.egs-field svg.egs-icon-search{
    fill: none;
    stroke: #2563eb;
    stroke-width: 2.2;
    stroke-linecap: round;
}
/* orange pin, solid with a white dot */
.egs-field svg.egs-icon-pin{ fill: #ff5a00; stroke: none; }
.egs-field svg.egs-icon-pin circle{ fill: #fff; }

/* font-size as a LONGHAND. 16px is the floor that stops iOS
   from zooming the page when the field is tapped. */
.egs-card .egs-field input{
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: #1f2430;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    border-radius: 0;
}
.egs-card .egs-field input::placeholder{ color: #8b93a3; opacity: 1; }

/* base.css styles input[type="text"]:focus with a border and a box-shadow at the
   same specificity as the rule above. This one is higher, so load order can't
   bite us. */
.egs-card .egs-field input:focus{
    border: 0;
    outline: none;
    box-shadow: none;
    color: #1f2430;
}

/* ---------- states ---------- */
.egs-field.is-error{
    border-color: #dc3d2c;
    background: #fff8f7;
}
.egs-field.is-resolved{ border-color: #1a9d48; }
.egs-field.is-resolved svg.egs-icon-pin{ fill: #1a9d48; }

/* ---------- button ----------
   base.css paints every <button> with a grey gradient, a border, an 11px bold
   face, a white text-shadow and margin-bottom:20px - and its :hover and :active
   rules outrank a bare class. Every one of those is overridden below. */
.egs-go{
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 58px;
    margin: 0;
    padding: 0 30px;
    border: 0;
    border-radius: 12px;
    background: #ff5a00;
    color: #fff;
    font-size: 17px;
    font-family: inherit;
    font-weight: 500;
    line-height: 1;
    text-shadow: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.egs-go svg{
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.egs-go:hover,
.egs-go:focus,
.egs-go:active{
    border: 0;
    color: #fff;
    text-shadow: none;
}
.egs-go:hover{ background: #ea5200; }
.egs-go:active{ background: #d84c00; }
.egs-go:focus-visible{ outline: 2px solid #1a3fa0; outline-offset: 3px; }
.egs-go[aria-busy="true"]{ opacity: .7; cursor: default; }

/* ---------- trust row under the card ---------- */
.egs-trust{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}
.egs-trust li{
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 0 22px;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.3;
    color: #47525f;
    white-space: nowrap;
}
.egs-trust li + li{ border-left: 1px solid #cfd4d9; }
.egs-trust svg{
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    fill: #2563eb;
}
.egs-trust svg .egs-knock{ fill: #fff; }

/* ---------- suggestion list ---------- */
.egs-list{
    position: absolute;
    top: calc(100% + 8px);
    left: -1.5px;
    right: -1.5px;
    z-index: 9998;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 14px;
    box-shadow: 0 12px 34px rgba(16,24,40,.16);
    max-height: 296px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.egs-list li{
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 15px;
    line-height: 1.35;
    color: #333;
    cursor: pointer;
}
.egs-list li strong{ font-weight: 700; color: #111; }
.egs-list li:hover,
.egs-list li[aria-selected="true"]{ background: #eff4fb; }
.egs-list .egs-cc{
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 11px;
    letter-spacing: .06em;
    color: #98a1ac;
}

/* ---------- spinner ---------- */
.egs-spin{
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    border: 2px solid #e3e8ef;
    border-top-color: #ff5a00;
    border-radius: 50%;
    animation: egs-turn .7s linear infinite;
}
@keyframes egs-turn{ to{ transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce){
    .egs-spin{ animation: none; }
    .egs-field{ transition: none; }
}

/* ---------- status / error line ---------- */
.egs-status{
    margin: 12px 0 0;
    min-height: 20px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    color: #6b7480;
}
.egs-status.is-ok{ color: #1a7f37; }
.egs-status.is-err{ color: #c22b1f; }

/* ---------- stack on narrow screens ---------- */
@media only screen and (max-width: 767px){
    .egs-band{ padding: 16px 0 20px; }
    .egs-card{
        flex-direction: column;
        gap: 10px;
        padding: 12px;
        border-radius: 16px;
    }

    /* flex: 1 1 0 above sets flex-basis: 0, and in a COLUMN container the basis
       is the HEIGHT - it overrides the height property, which collapsed these
       to 25px. Resetting the basis is what makes the height take effect. */
    .egs-field{
        flex: 0 0 auto;
        height: 58px;
        padding: 0 15px;
    }
    .egs-go{ height: 58px; width: 100%; padding: 0 20px; }
    .egs-list{ left: -1.5px; right: -1.5px; }

    /* keep the three items on one row - they need 340px and fit from 360px up.
       Under that they wrap to two rows rather than overflow. */
    .egs-trust{ margin-top: 14px; }
    .egs-trust li{
        flex: 0 1 auto;
        gap: 5px;
        padding: 0 7px;
        font-size: 11px;
    }
    .egs-trust svg{ width: 14px; height: 14px; }
}
