/* =========================================================
   ToolZen Hub
   Date Calculator

   Only what the shared tool styles do not already provide: the
   start date with the Add / Subtract choice, the four amounts,
   the result note and the trust note. Buttons, focus, fields and
   headings come from the shared layer. Loaded after
   calculator-responsive.css.
========================================================= */

.dcalc-start {

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    align-items: start;

}

/* the four amounts: one row on a wide screen, two by two on a narrow one (never four across) */

.dcalc-amounts {

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

}

.dcalc-input {

    min-height: 48px;

    font-size: 16px;

}

/* the operation: two large segments; the chosen one has a tick and a heavier border as well as a colour */

.dcalc-mode {

    min-width: 0;

    margin: 0;
    padding: 0;

    border: 0;

}

.dcalc-mode legend {

    padding: 0;

}

.dcalc-mode__options {

    display: flex;
    gap: 8px;

    margin: 6px 0 0;

}

.dcalc-mode__option {

    position: relative;

    display: inline-flex;

    flex: 1 1 0;

    cursor: pointer;

}

/* the radio itself is hidden; its label is the control and keeps the focus ring */

.dcalc-mode__option input {

    position: absolute;

    width: 1px;
    height: 1px;

    margin: 0;

    opacity: 0;

}

.dcalc-mode__option span {

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    box-sizing: border-box;

    width: 100%;
    min-height: 48px;

    padding: 8px 14px;

    border: 1px solid #d0d5dd;
    border-radius: 10px;

    background: var(--color-white);

    color: #344054;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;

    transition:
        background .2s ease,
        border-color .2s ease;

}

.dcalc-mode__option:hover span {

    background: #f2f4f7;

}

.dcalc-mode__option input:checked + span {

    border: 2px solid var(--color-brand-green);

    background: #ecfdf3;

    color: var(--color-ink);

    font-weight: 750;

}

.dcalc-mode__option input:checked + span::before {

    content: "✓";
    content: "✓" / "";

    font-weight: 800;

}

.dcalc-mode__option input:focus-visible + span {

    outline: 2px solid var(--color-brand-green);
    outline-offset: 2px;

}

/* three results in a row: the date is the largest */

#dcalc-results .calculator-results__grid {

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

}

#dcalc-results .calculator-results__item--primary {

    grid-column: auto;

}

#dcalc-results .calculator-results__summary p {

    margin: 0;

}

.dcalc-note,
.dcalc-trust {

    margin: 14px 0 0;
    padding: 12px 14px;

    border: 1px solid var(--color-slate-200);
    border-radius: 10px;

    background: #f9fafb;

    color: #344054;

    font-size: 13px;
    line-height: 1.6;

}

.dcalc-note {

    color: var(--color-ink);

    font-size: 14px;
    font-weight: 600;

}

.dcalc-trust strong {

    color: var(--color-ink);

}

@media (max-width: 820px) {

    .dcalc-amounts {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

    }

    .dcalc-start,
    #dcalc-results .calculator-results__grid {

        grid-template-columns:
            minmax(0, 1fr);

    }

}

.dcalc-sr-only {

    position: absolute;

    width: 1px;
    height: 1px;

    margin: -1px;
    padding: 0;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;

}
