/**
 * Sky Toolkit — Address Autocomplete styles
 * Copied from SkyDonate address-autoload.css; retargeted from WooCommerce
 * billing rows to MemberPress signup rows (.mp-form-row.mepr_<field_key>).
 */

/* ============================================
   Compact Mode: reveal rules
   (the hide rules are printed inline at form render time by the module,
   so the rows never flash before this footer stylesheet loads)
   ============================================ */
.mp-form-row.mepr_mepr-address-one.sky-aa-show,
.mp-form-row.mepr_mepr-address-two.sky-aa-show,
.mp-form-row.mepr_mepr-address-city.sky-aa-show,
.mp-form-row.mepr_mepr-address-state.sky-aa-show,
.mp-form-row.mepr_mepr-address-zip.sky-aa-show,
.mp-form-row.mepr_mepr-address-country.sky-aa-show {
    display: block !important;
}

/* ============================================
   Search field row (injected)
   ============================================ */
#sky_aa_search_field .sky-aa-search-icon {
    margin-right: 6px;
}
#sky_aa_search_field input#sky_aa_search {
    width: 100%;
}

/* ============================================
   Layout 1: Summary bar below search field
   ============================================ */
.sky-aa-address-summary {
    background: #f0faf0;
    border: 1px solid #c3e6c3;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}

.sky-aa-address-summary .address-summary-text {
    color: #333;
    flex: 1;
    line-height: 1.4;
}

.sky-aa-address-summary .address-summary-edit {
    color: #16a34a;
    cursor: pointer;
    text-decoration: underline;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
}

.sky-aa-address-summary .address-summary-edit:hover {
    color: #15803d;
}

/* ============================================
   Layout 2: Inline edit text inside field
   ============================================ */
#sky_aa_search_field .sky-aa-inline-edit {
    display: none;
    align-items: center;
    gap: 4px;
    position: absolute;
    right: 12px;
    top: 0;
    bottom: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
    color: #16a34a;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    text-decoration: underline;
}

#sky_aa_search_field .sky-aa-inline-edit:hover {
    color: #15803d;
}

#sky_aa_search_field .sky-aa-inline-edit svg {
    width: 14px;
    height: 14px;
    fill: #16a34a;
    flex-shrink: 0;
}

#sky_aa_search_field .sky-aa-inline-edit:hover svg {
    fill: #15803d;
}

#sky_aa_search_field .sky-aa-inline-edit.visible {
    display: inline-flex;
}

#sky_aa_search_field.has-inline-edit {
    position: relative;
}

#sky_aa_search_field.has-inline-edit input#sky_aa_search {
    padding-right: 70px;
}

/* ============================================
   Enter manually link
   ============================================ */
.sky-aa-enter-manually {
    margin-top: 4px;
    margin-bottom: 0;
}

.sky-aa-enter-manually .enter-address-manually-btn {
    color: #16a34a;
    cursor: pointer;
    text-decoration: underline;
    font-size: 13px;
}

.sky-aa-enter-manually .enter-address-manually-btn:hover {
    color: #15803d;
}

/* ============================================
   Designer layout — "Register - Address Lookup" design
   ============================================ */
.sky-aa2-row { margin-bottom: 22px; }

.sky-aa2-addr {
    border: 1.5px solid #8ad6a3;
    border-radius: 10px;
    padding: 0 15px;
    background: #fff;
    position: relative;
    overflow: hidden;
}
.sky-aa2-row.is-editing .sky-aa2-edit { display: none; }
.sky-aa2-input-wrap { display: flex; align-items: center; gap: 12px; }
.sky-aa2-input-wrap > svg { width: 18px; height: 18px; color: #16A34A; flex: none; }
.sky-aa2-addr input.sky-aa2-input {
    flex: 1 1 auto; min-width: 0;
    font: inherit; font-size: 16px; color: #1c2333; font-weight: 500; line-height: 1.4;
    border: none; outline: none; background: transparent;
    padding: 12px 0; letter-spacing: -.01em; box-shadow: none; height: auto;
}
.sky-aa2-addr input.sky-aa2-input:focus { border: none; outline: none; box-shadow: none; }
.sky-aa2-addr input.sky-aa2-input::placeholder { color: #97a0af; font-weight: 500; }

/* suggestions dropdown */
.sky-aa2-suggestions {
    list-style: none; margin: 0 -15px; padding: 6px 0;
    border-top: 1px solid #e7e9ee;
    max-height: 296px; overflow-y: auto;
}
.sky-aa2-suggestions:empty { display: none; }
.sky-aa2-sug {
    display: flex; align-items: center; gap: 13px; cursor: pointer;
    padding: 11px 15px; font-size: 15px; color: #1c2333;
    transition: background .12s ease; margin: 0;
}
.sky-aa2-sug:hover, .sky-aa2-sug.active { background: #f3fbf5; }
.sky-aa2-sug .sky-aa2-pin { width: 19px; height: 19px; flex: none; color: #9aa3b2; }
.sky-aa2-sug:hover .sky-aa2-pin, .sky-aa2-sug.active .sky-aa2-pin { color: #16A34A; }
.sky-aa2-sug b { font-weight: 800; color: #16264A; }
.sky-aa2-sug .sky-aa2-sug-sub { color: #5b6577; }
.sky-aa2-empty { padding: 14px 15px; color: #5b6577; font-size: 14.5px; margin: 0; }
.sky-aa2-loading { padding: 14px 15px; color: #5b6577; font-size: 14.5px; display: flex; align-items: center; gap: 10px; margin: 0; }
.sky-aa2-spin {
    width: 16px; height: 16px; border-radius: 50%; flex: none;
    border: 2px solid #8ad6a3; border-top-color: #16A34A;
    animation: sky-aa2-spin .7s linear infinite;
}
@keyframes sky-aa2-spin { to { transform: rotate(360deg); } }

/* thin full-width divider above the manual-entry hint, 2px below the input */
.sky-aa2-manual-hint { font-size: 13px; color: #5b6577; margin: 2px -15px 0; padding: 8px 15px 12px; border-top: 1px solid #e7e9ee; display: block; }
.sky-aa2-manual-hint a { color: #16A34A; font-weight: 800; text-decoration: underline; }

/* selected summary — same height as a normal input */
.sky-aa2-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; }
.sky-aa2-summary-text { min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.sky-aa2-summary-text > svg { width: 18px; height: 18px; color: #16A34A; flex: none; }
.sky-aa2-summary-value {
    display: block; font-size: 16px; font-weight: 600; color: #1c2333;
    letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
button.sky-aa2-edit {
    flex: none; display: inline-flex; align-items: center; gap: 7px;
    background: none; border: none; cursor: pointer; padding: 4px;
    color: #16A34A; font: inherit; font-weight: 800; font-size: 14px;
    text-decoration: underline; text-underline-offset: 3px; box-shadow: none;
}
button.sky-aa2-edit svg { width: 15px; height: 15px; }
button.sky-aa2-edit:hover { color: #0f7e39; background: none; }

/* confirmed fields (green) */
.sky-aa2-confirmed { display: grid; gap: 18px; margin-top: 18px; }
/* The display:grid above would defeat the hidden attribute (whose effect is only
   a UA-level display:none) — enforce hidden states explicitly. */
.sky-aa2-confirmed[hidden],
.sky-aa2-search-state[hidden],
.sky-aa2-selected-state[hidden] { display: none !important; }
.sky-aa2-cfield {
    border: 1.5px solid #8ad6a3; border-radius: 10px; background: #fff;
    padding: 11px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sky-aa2-cfield-body { flex: 1 1 auto; min-width: 0; }
/* label sits ABOVE the green box, styled like every other form label */
.sky-aa2-cfield-lbl { display: block; font-weight: 700; font-size: 15.5px; color: #16264A; margin: 0 0 8px; letter-spacing: -.005em; }
.sky-aa2-req { color: #ED1B24; margin-left: 2px; }
.sky-aa2-cfield input.sky-aa2-cfield-input,
.sky-aa2-cfield select.sky-aa2-cfield-input {
    width: 100%; border: none; outline: none; background: transparent; font: inherit;
    font-size: 16px; font-weight: 600; color: #1c2333; padding: 1px 0;
    letter-spacing: -.01em; box-shadow: none; height: auto;
}
.sky-aa2-cfield input.sky-aa2-cfield-input:focus,
.sky-aa2-cfield select.sky-aa2-cfield-input:focus { border: none; outline: none; box-shadow: none; }
.sky-aa2-cfield .sky-aa2-check {
    width: 24px; height: 24px; flex: none; color: #16A34A;
    opacity: 0; transform: scale(.6);
    transition: opacity .2s ease, transform .25s cubic-bezier(.2,1.3,.4,1);
}
.sky-aa2-cfield.ok .sky-aa2-check { opacity: 1; transform: scale(1); }

