/**
 * Installation availability picker.
 *
 * Sits inside the My Account content column, so it works with whatever width
 * the theme gives it rather than assuming a page of its own.
 *
 * Brand: #145AE2 primary, #124CBF hover, #F2F5F7 surface, #0D2E6E ink,
 * #F5B301 for the call to action once the minimum is met.
 */

.ed-isp-picker {
    --ed-blue: #145ae2;
    --ed-blue-dark: #124cbf;
    --ed-ink: #0d2e6e;
    --ed-surface: #f2f5f7;
    --ed-border: #e3e8ef;
    --ed-muted: #5c6b7a;
    --ed-go: #f5b301;

    font-size: 15px;
    line-height: 1.55;
    color: #1f2933;
}

/* ---------- Account menu icon ---------- */

/*
 * Blocksy paints an icon per known My Account endpoint and falls back to a
 * document for anything it does not recognise, which is what ours got.
 * Drawn as a mask so it takes currentColor and matches the neighbouring icons
 * in every state instead of being a fixed-colour image.
 */
.woocommerce-MyAccount-navigation-link--installation-appointment a::before {
    content: "" !important;
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: none !important;
    background-color: currentColor !important;
    -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3Cpath d='m9 16 2 2 4-4'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3Cpath d='m9 16 2 2 4-4'/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* ---------- Banner and hero ---------- */

.ed-isp-picker__banner {
    padding: 12px 18px;
    margin: 0 0 18px 0;
    border-radius: 8px;
    background-color: #eaf0fd;
    font-size: 14px;
}

.ed-isp-picker__banner strong {
    color: var(--ed-blue);
}

.ed-isp-picker__banner span {
    color: var(--ed-muted);
}

.ed-isp-picker__hero {
    padding: 28px 30px;
    margin: 0 0 24px 0;
    border-radius: 10px;
    background-color: var(--ed-blue);
    color: #fff;
}

.ed-isp-picker__eyebrow {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ed-go);
}

.ed-isp-picker__title {
    margin: 0 0 8px 0;
    font-size: 27px;
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
}

.ed-isp-picker__lede {
    margin: 0;
    max-width: 46ch;
    color: rgba(255, 255, 255, 0.88);
}

/* ---------- Messages ---------- */

.ed-isp-picker__notice {
    padding: 14px 18px;
    margin: 0 0 20px 0;
    border-left: 3px solid var(--ed-blue);
    border-radius: 6px;
    background-color: var(--ed-surface);
}

.ed-isp-picker__notice strong {
    display: block;
    color: var(--ed-ink);
}

.ed-isp-picker__notice--success {
    border-left-color: #1e6b34;
    background-color: #eef7f1;
}

.ed-isp-picker__notice--error {
    border-left-color: #a3272f;
    background-color: #fdefef;
}

/* ---------- Card ---------- */

.ed-isp-picker__card {
    border: 1px solid var(--ed-border);
    border-radius: 10px;
    background-color: #fff;
    overflow: hidden;
}

.ed-isp-picker__card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--ed-border);
}

.ed-isp-picker__card-title {
    margin: 0 0 2px 0;
    font-size: 19px;
    font-weight: 700;
    color: var(--ed-ink);
}

.ed-isp-picker__card-sub {
    margin: 0;
    font-size: 14px;
    color: var(--ed-muted);
}

.ed-isp-picker__progress {
    text-align: right;
}

.ed-isp-picker__progress-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--ed-muted);
}

.ed-isp-picker__progress-bars {
    display: inline-flex;
    gap: 5px;
}

.ed-isp-picker__progress-bar {
    display: block;
    width: 26px;
    height: 4px;
    border-radius: 2px;
    background-color: var(--ed-border);
}

.ed-isp-picker__progress-bar.is-filled {
    background-color: var(--ed-blue);
}

.ed-isp-picker__answered {
    margin: 0;
    padding: 12px 24px;
    border-bottom: 1px solid var(--ed-border);
    background-color: var(--ed-surface);
    font-size: 14px;
    color: var(--ed-muted);
}

/* ---------- Weeks and days ---------- */

.ed-isp-weeks {
    padding: 4px 24px 0;
}

.ed-isp-week + .ed-isp-week {
    margin-top: 8px;
}

.ed-isp-week__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0 8px;
}

.ed-isp-week__title {
    font-weight: 700;
    color: var(--ed-ink);
}

.ed-isp-week__count {
    font-size: 13px;
    color: var(--ed-muted);
}

.ed-isp-day {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 7px 0;
}

.ed-isp-day__date {
    flex: 0 0 92px;
}

.ed-isp-day__weekday {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ed-muted);
}

.ed-isp-day__number {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--ed-ink);
}

.ed-isp-day__slots {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    gap: 12px;
}

/*
 * The checkbox stays in the page and does the work - it is what submits and
 * what the keyboard operates - while the label is what you see.
 *
 * Written defensively on purpose. WooCommerce and the theme both style
 * input[type="checkbox"] with selectors more specific than a single class, and
 * when one of those won the box came back into the flow and shunted the label
 * after it down a few pixels - which is why the afternoon buttons sat out of
 * line with the morning ones.
 */
.ed-isp-picker input.ed-isp-slot__input,
.ed-isp-day__slots input[type="checkbox"].ed-isp-slot__input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0 !important;
    float: none !important;
    vertical-align: baseline !important;
    -webkit-appearance: none;
    appearance: none;
}

.ed-isp-picker .ed-isp-slot {
    position: relative;
    flex: 1 1 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
    /* Themes like to give labels a bottom margin; that would tip the pair. */
    margin: 0;
    padding: 13px 16px;
    border: 1px solid var(--ed-border);
    border-radius: 8px;
    cursor: pointer;
    line-height: 1.4;
    transition: border-color 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}

.ed-isp-slot:hover {
    border-color: var(--ed-blue);
}

.ed-isp-slot__name {
    font-weight: 600;
}

.ed-isp-slot__hours {
    font-size: 13px;
    color: var(--ed-muted);
}

.ed-isp-slot__tick {
    margin-left: auto;
    opacity: 0;
    font-weight: 700;
}

.ed-isp-slot__input:checked + .ed-isp-slot {
    background-color: var(--ed-blue);
    border-color: var(--ed-blue);
    color: #fff;
}

.ed-isp-slot__input:checked + .ed-isp-slot .ed-isp-slot__hours {
    color: rgba(255, 255, 255, 0.85);
}

.ed-isp-slot__input:checked + .ed-isp-slot .ed-isp-slot__tick {
    opacity: 1;
}

/* Focus has to stay visible once the checkbox itself is not. */
.ed-isp-slot__input:focus-visible + .ed-isp-slot {
    outline: 2px solid var(--ed-blue);
    outline-offset: 2px;
}

/* ---------- Card footer ---------- */

.ed-isp-picker__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 20px;
    padding: 20px 24px;
    border-top: 1px solid var(--ed-border);
}

.ed-isp-picker__foot-status strong {
    display: block;
    color: var(--ed-ink);
}

.ed-isp-picker__foot-status span {
    font-size: 14px;
    color: var(--ed-muted);
}

.ed-isp-picker__foot-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ed-isp-picker__clear {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ed-muted);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.ed-isp-picker__clear[disabled] {
    opacity: 0.4;
    cursor: default;
    text-decoration: none;
}

/*
 * Enabled by default and locked by script, not the other way round. With
 * JavaScript blocked the button has to look and behave like a button - the
 * server still refuses a short selection and says why.
 */
.ed-isp-picker__submit {
    padding: 13px 26px;
    border: 0;
    border-radius: 8px;
    background-color: var(--ed-go);
    color: #1f2933;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.ed-isp-picker__submit:hover:not(.is-locked) {
    background-color: #e0a400;
}

.ed-isp-picker__submit.is-locked {
    background-color: var(--ed-border);
    color: var(--ed-muted);
    cursor: not-allowed;
}

/* ---------- Sent ---------- */

.ed-isp-done {
    padding: 40px 30px;
    border: 1px solid var(--ed-border);
    border-radius: 10px;
    background-color: #fff;
    text-align: center;
}

.ed-isp-done__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    border-radius: 50%;
    background-color: var(--ed-blue);
    color: #fff;
}

.ed-isp-done__mark svg {
    width: 30px;
    height: 30px;
}

.ed-isp-done__title {
    margin: 0 0 8px 0;
    font-size: 21px;
    font-weight: 700;
    color: var(--ed-ink);
}

.ed-isp-done__body {
    max-width: 46ch;
    margin: 0 auto;
    color: var(--ed-muted);
}

/* ---------- What happens next ---------- */

.ed-isp-next {
    margin-top: 22px;
    padding: 24px;
    border: 1px solid var(--ed-border);
    border-radius: 10px;
    background-color: #fff;
}

.ed-isp-next__title {
    margin: 0 0 18px 0;
    font-size: 19px;
    font-weight: 700;
    color: var(--ed-ink);
}

.ed-isp-next__steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.ed-isp-next__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-bottom: 10px;
    border-radius: 6px;
    background-color: var(--ed-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.ed-isp-next__step strong {
    display: block;
    margin-bottom: 4px;
    color: var(--ed-ink);
}

.ed-isp-next__step p {
    margin: 0;
    font-size: 14px;
    color: var(--ed-muted);
}

/* ---------- Help ---------- */

.ed-isp-help {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 24px;
    border-radius: 10px;
    background-color: #10233f;
    color: #fff;
}

.ed-isp-help strong {
    display: block;
    margin-bottom: 4px;
    font-size: 17px;
}

.ed-isp-help p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
}

.ed-isp-help__button {
    flex: 0 0 auto;
    padding: 12px 22px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.ed-isp-help__button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.ed-isp-picker__tz {
    margin: 16px 0 0 0;
    font-size: 13px;
    color: var(--ed-muted);
}

/* ---------- Narrow screens ---------- */

@media screen and (max-width: 782px) {
    .ed-isp-picker__hero {
        padding: 22px 20px;
    }

    .ed-isp-picker__title {
        font-size: 23px;
    }

    .ed-isp-picker__card-head,
    .ed-isp-picker__foot {
        padding-left: 18px;
        padding-right: 18px;
    }

    .ed-isp-weeks {
        padding-left: 18px;
        padding-right: 18px;
    }

    .ed-isp-picker__progress {
        text-align: left;
    }

    .ed-isp-next__steps {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    /*
     * Below this width the date column and two buttons on one line leaves the
     * buttons too narrow to read, so the day stacks: date above, the two
     * half-days side by side underneath.
     */
    .ed-isp-day {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 0;
    }

    .ed-isp-day__date {
        flex: 0 0 auto;
    }

    .ed-isp-day__weekday,
    .ed-isp-day__number {
        display: inline;
    }

    .ed-isp-day__number {
        margin-left: 6px;
    }

    .ed-isp-slot {
        padding: 11px 13px;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .ed-isp-slot__tick {
        position: absolute;
        top: 11px;
        right: 13px;
        margin-left: 0;
    }

    .ed-isp-picker__foot,
    .ed-isp-picker__foot-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ed-isp-picker__submit,
    .ed-isp-help__button {
        width: 100%;
        text-align: center;
    }

    .ed-isp-help {
        flex-direction: column;
        align-items: stretch;
    }
}
