/* Vision Domestic Abuse Cost Calculator - matches the look of the existing Vision calculators. */

.vda-section {
    --vda-navy: #2E2E86;
    --vda-red: #E30613;
    --vda-group-red: #C0392B;
    --vda-sub: #4A4CA7;
    --vda-row: rgba(127, 127, 127, 0.15);
    --vda-yellow: #FFC107;
    --vda-button-text: #FBB800;
    font-family: 'Poppins', sans-serif;
    color: var(--vda-navy);
}

.vda-section *,
.vda-section *::before,
.vda-section *::after {
    box-sizing: border-box;
}

.vda-section [hidden] {
    display: none !important;
}

/* Grey band with the red band behind the lower part of the card */
.vda-section.vda-has-bg {
    position: relative;
    padding: 0 15px 65px;
    background: linear-gradient(to bottom, rgba(204, 205, 207, 0.5) 0, rgba(204, 205, 207, 0.5) 200px, var(--vda-red) 200px, var(--vda-red) 100%);
}

.vda-calc {
    position: relative;
    max-width: 1005px;
    margin: 0 auto;
    padding: 20px 100px 50px;
    background: #fff;
    border-radius: 14px;
}

/* Section headings */
.vda-title-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #979797;
}

.vda-calc .vda-title {
    width: 50%;
    padding-right: 15px;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    font-weight: 300;
    line-height: 1.2;
    color: var(--vda-navy);
}

.vda-calc .vda-title span {
    font-weight: 600;
    color: var(--vda-red);
}

.vda-calc .vda-desc {
    width: 50%;
    margin: 0;
    font-size: 18px;
    color: #000;
}

/* Rows */
.vda-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 25px;
    margin-bottom: 20px;
    background: var(--vda-row);
    border-radius: 14px;
    font-size: 18px;
    font-weight: 600;
}

.vda-calc .vda-label {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--vda-navy);
    cursor: pointer;
}

.vda-row--head .vda-label--group {
    color: var(--vda-group-red);
}

.vda-row--sub {
    margin-bottom: 0;
    padding: 15px 25px 15px 60px;
    border-radius: 0;
}

.vda-row--sub .vda-label {
    color: var(--vda-sub);
}

.vda-group {
    margin-bottom: 20px;
}

.vda-group.is-open .vda-row--head {
    margin-bottom: 0;
    padding-bottom: 15px;
    border-radius: 14px 14px 0 0;
}

.vda-row--head {
    margin-bottom: 0;
}

.vda-group-items .vda-row--sub:last-child {
    padding-bottom: 20px;
    border-radius: 0 0 14px 14px;
}

/* Checkboxes: the real input is visually hidden, the white box is its label */
.vda-cb {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.vda-box {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    margin: 0 0 0 auto;
    background: #fff;
    border-radius: 14px;
    cursor: pointer;
}

.vda-cb:checked ~ .vda-box {
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 33 25'%3E%3Cpath d='M2.5 13.5l9 8.5L30.5 3' fill='none' stroke='%23E30613' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 33px 25px;
}

.vda-cb:focus-visible ~ .vda-box {
    outline: 3px solid var(--vda-navy);
    outline-offset: 2px;
}

.vda-row--sub .vda-box {
    margin-right: 48px;
}

/* Accordion arrow */
.vda-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    margin-left: 10px;
    border: 0;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 12'%3E%3Cpath d='M7 11L1 1h12z' fill='%23808080'/%3E%3C/svg%3E") no-repeat center / 14px 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.vda-group.is-open .vda-toggle {
    transform: rotate(180deg);
}

.vda-toggle:focus-visible {
    outline: 3px solid var(--vda-navy);
    outline-offset: 2px;
}

.vda-section .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Area dropdown */
.vda-area-row {
    justify-content: space-between;
    flex-wrap: wrap;
}

.vda-calc .vda-area-select {
    width: 50%;
    min-width: 240px;
    padding: 10px 44px 10px 20px;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 18px;
    color: #000;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23808080' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 18px center / 14px 9px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.vda-calc .vda-area-select:focus-visible {
    outline: 3px solid var(--vda-navy);
    outline-offset: 2px;
}

.vda-area-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 30px;
    margin: -8px 0 20px;
    padding: 0 25px;
    font-size: 16px;
    color: #333;
}

.vda-area-stats strong {
    color: var(--vda-navy);
}

/* Specialist services calculator: number of service users (same look as the SV calculator) */
.vda-users-row {
    display: flex;
    flex-wrap: wrap;
    padding: 0 0 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--vda-red);
}

/* Grey box the same width as the SV calculator's; it narrows on small screens */
.vda-users-field {
    display: flex;
    align-items: center;
    max-width: 100%;
    padding: 10px 0;
}

.vda-calc .vda-users-input {
    flex: 0 1 180px;
    width: 180px;
    min-width: 67px;
    height: 48px;
    margin: 0 25px 0 0;
    padding: 0 10px;
    border: none;
    border-radius: 14px;
    background: var(--vda-row);
    box-shadow: none;
    font-family: inherit;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    color: rgba(0, 0, 0, 0.5);
    -moz-appearance: textfield;
    appearance: textfield;
}

.vda-calc .vda-users-input::-webkit-outer-spin-button,
.vda-calc .vda-users-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.vda-calc .vda-users-input:focus {
    outline: none;
    background: rgba(127, 127, 127, 0.22);
}

.vda-calc .vda-users-input:focus-visible {
    outline: 3px solid var(--vda-navy);
    outline-offset: 2px;
}

.vda-calc .vda-users-label {
    flex: 0 0 auto;
    margin: 0 8px 0 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--vda-red);
    cursor: pointer;
}

/* Tooltips */
.vda-tip-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.vda-calc .vda-info {
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #767676;
    color: #fff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
}

.vda-calc .vda-info:focus-visible {
    outline: 2px solid var(--vda-navy);
    outline-offset: 2px;
}

.vda-tip {
    position: absolute;
    top: calc(100% + 8px);
    left: -20px;
    z-index: 1000;
    width: 300px;
    padding: 16px 20px;
    border-radius: 8px;
    background: var(--vda-navy);
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    overflow-wrap: anywhere;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
    pointer-events: none;
}

.vda-tip-wrap:hover .vda-tip,
.vda-info:focus-visible + .vda-tip,
.vda-tip-wrap.is-open .vda-tip {
    display: block;
}

/* Calculate button */
.vda-calc .vda-calc-btn {
    display: block;
    min-width: 200px;
    margin: 32px auto 0;
    padding: 14px 31px;
    border: none;
    border-radius: 8px;
    background: #000;
    color: var(--vda-button-text);
    font-family: inherit;
    font-size: 1.2em;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.vda-calc .vda-calc-btn:hover:not(:disabled) {
    background: #333;
}

.vda-calc .vda-calc-btn:disabled {
    background: #CCCDCF;
    color: rgba(0, 0, 0, 0.5);
    font-weight: 500;
    cursor: not-allowed;
}

.vda-calc .vda-calc-btn:focus-visible {
    outline: 3px solid var(--vda-navy);
    outline-offset: 3px;
}

/* Results */
.vda-results {
    margin-top: 32px;
    padding: 42px 95px;
    background: var(--vda-yellow);
    border-radius: 12px;
}

.vda-calc .vda-results-title {
    margin: 0 0 16px;
    font-size: 36px;
    font-weight: 700;
    color: var(--vda-navy);
}

.vda-results-content {
    padding-top: 10px;
    border-top: 1px solid var(--vda-red);
    font-size: 16px;
    color: #000;
}

.vda-result-line + .vda-result-line {
    margin-top: 10px;
}

.vda-result-line--total {
    margin-top: 14px !important;
    padding-top: 14px;
    border-top: 1px solid var(--vda-red);
    font-size: 1.1em;
    font-weight: 700;
    color: var(--vda-navy);
}

/* Send me a copy (Contact Form 7) */
.vda-email {
    margin-top: 32px;
    padding: 60px 95px;
    background: #CCCDCF;
    border-radius: 14px;
}

.vda-calc .vda-email h3 {
    margin: 0 0 15px;
    font-size: 36px;
    font-weight: 700;
    color: var(--vda-navy);
}

/* Responsive */
@media (max-width: 991px) {
    .vda-calc { padding: 20px 50px 40px; }
    .vda-calc .vda-title { font-size: 28px; }
    .vda-calc .vda-desc { font-size: 16px; }
    .vda-calc .vda-label,
    .vda-row { font-size: 16px; }
    .vda-results { padding: 30px 50px; }
    .vda-email { padding: 50px 40px; }
    .vda-calc .vda-results-title,
    .vda-calc .vda-email h3 { font-size: 28px; }
}

@media (max-width: 767px) {
    .vda-calc { padding: 20px 20px 30px; }
    .vda-calc .vda-title,
    .vda-calc .vda-desc { width: 100%; padding-right: 0; }
    .vda-calc .vda-title { font-size: 24px; margin-bottom: 8px; }
    .vda-calc .vda-desc { font-size: 14px; }
    .vda-row { padding: 15px; }
    .vda-row--sub { padding: 12px 15px 12px 30px; }
    .vda-row--sub .vda-box { margin-right: 38px; }
    .vda-box { width: 36px; height: 36px; border-radius: 10px; }
    .vda-cb:checked ~ .vda-box { background-size: 20px 16px; }
    .vda-calc .vda-area-select { width: 100%; font-size: 16px; border-radius: 10px; }
    .vda-calc .vda-users-label { font-size: 16px; }
    .vda-users-row { position: relative; }
    .vda-users-field { width: 100%; }
    /* On phones the tooltip spans the row instead of hanging off the icon. */
    .vda-tip-wrap { position: static; }
    .vda-tip { left: 15px; right: 15px; width: auto; top: calc(100% - 6px); }
    .vda-results { padding: 30px 20px; }
    .vda-email { padding: 40px 20px 35px; }
    .vda-calc .vda-results-title,
    .vda-calc .vda-email h3 { font-size: 24px; }
    .vda-calc .vda-calc-btn { width: 100%; }
}
