/* Lead form: Contact Form module + [el_lead_form] (partials/el-lead-form.php) */
.el-lead-form {
    position: relative;
}

.el-req {
    color: var(--el-color-orange);
}

.el-field {
    margin: 0 0 12px;
}

/* Email + phone in one row on desktop (every lead form) */
@media (min-width: 1200px) {
    .el-lead-pair {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 14px;
        align-items: start;
    }
}

.el-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 17px;
    color: var(--el-color-navy);
}

.el-field input,
.el-field textarea,
.el-field select {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #d5dde4;
    border-radius: 6px;
    background: var(--el-color-white);
    font: inherit;
    font-size: 16px;
    color: var(--el-color-navy);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.el-field textarea {
    min-height: 96px;
    resize: vertical;
}

/* Diagnostic form: the result as a summary card (program | score + band), stacked on phones */
.el-lead-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    margin: 0 0 14px;
    border: 1px solid #d9e1e8;
    border-left: 4px solid var(--el-color-orange);
    border-radius: 12px;
    background: #f6f9fb;
}

.el-lead-summary > div {
    padding: 9px 14px;
}

.el-lead-summary > div + div {
    border-left: 1px solid #d9e1e8;
}

.el-lead-summary dt {
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7c8b99;
}

.el-lead-summary dd {
    margin: 0;
    font-family: var(--el-font-heading);
    font-size: 16px;
    line-height: 1.3;
    color: var(--el-color-navy);
}

.el-lead-summary small {
    font-family: var(--el-font-body);
    font-size: 12px;
    color: #7c8b99;
}

.el-lead-summary-band {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--el-color-navy);
    font-family: var(--el-font-body);
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
    color: var(--el-color-white);
}

@media (max-width: 575px) {
    .el-lead-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .el-lead-summary > div + div {
        border-top: 1px solid #d9e1e8;
        border-left: 0;
    }
}

/* Dropdown: same box as the inputs, with a chevron. Grey until a choice is made. */
.el-field select {
    padding-right: 44px;
    appearance: none;
    background: var(--el-color-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%230c1d27' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 18px center;
    cursor: pointer;
}

/* Grey while "Select an option" (empty) is chosen. */
.el-field select:has(option[value=""]:checked) {
    color: #9aa5b1;
}

.el-field select option {
    color: var(--el-color-navy);
}

.el-field input::placeholder,
.el-field textarea::placeholder {
    color: #9aa5b1;
}

.el-field input:focus,
.el-field textarea:focus,
.el-field select:focus {
    border-color: var(--el-color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(51, 121, 190, 0.15);
}

/* Field errors */
.el-field-error {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.4;
    color: #c0392b;
}

.el-field.is-invalid > input,
.el-field.is-invalid > textarea,
.el-field.is-invalid > select,
.el-field.is-invalid .el-phone {
    border-color: #c0392b;
}

.el-field.is-invalid > input:focus,
.el-field.is-invalid > textarea:focus,
.el-field.is-invalid > select:focus,
.el-field.is-invalid .el-phone:focus-within {
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

/* Phone: one box. The border sits on the wrapper; the code button and the number field
   have none, with a thin divider between them. */
.el-phone {
    position: relative;
    display: flex;
    align-items: stretch;
    border: 1px solid #d5dde4;
    border-radius: 6px;
    background: var(--el-color-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.el-phone:focus-within {
    border-color: var(--el-color-primary);
    box-shadow: 0 0 0 3px rgba(51, 121, 190, 0.15);
}

.el-field .el-phone input[type="tel"],
.el-field .el-phone input[type="tel"]:focus {
    flex: 1;
    min-width: 0;
    border: 0;
    border-radius: 0 6px 6px 0;
    background: transparent;
    box-shadow: none;
}

.el-phone-toggle {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 0 14px 0 16px;
    border: 0;
    border-radius: 6px 0 0 6px;
    background: transparent;
    font: inherit;
    font-size: 16px;
    color: var(--el-color-navy);
    cursor: pointer;
}

/* Divider between the code and the number. */
.el-phone-toggle::before {
    content: "";
    position: absolute;
    top: 9px;
    right: 0;
    bottom: 9px;
    width: 1px;
    background: #d5dde4;
}

.el-phone-toggle::after {
    content: "";
    width: 7px;
    height: 7px;
    margin: -4px 0 0 2px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.el-phone-toggle[aria-expanded="true"]::after {
    margin-top: 4px;
    transform: rotate(-135deg);
}

.el-phone-toggle:focus-visible {
    outline: 2px solid var(--el-color-primary);
    outline-offset: -2px;
}

/* Flags: 24x18 tiles from assets/images/flags.webp (16 columns, drawn at 2x). */
.el-flag {
    display: block;
    flex-shrink: 0;
    width: 24px;
    height: 18px;
    border-radius: 2px;
    background-image: var(--el-flags);
    background-size: 384px auto;
    background-color: #d5dde4;
    box-shadow: 0 0 0 1px rgba(12, 29, 39, 0.12);
}

.el-phone-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: -1px;
    z-index: 20;
    width: min(340px, calc(100% + 2px));
    overflow: hidden;
    border: 1px solid #d5dde4;
    border-radius: 8px;
    background: var(--el-color-white);
    box-shadow: 0 12px 32px rgba(12, 29, 39, 0.15);
}

.el-field .el-phone-menu .el-phone-search {
    padding: 10px 14px;
    border: 0;
    border-bottom: 1px solid #e0e6eb;
    border-radius: 0;
    font-size: 15px;
    box-shadow: none;
}

.el-phone-list {
    max-height: 260px;
    margin: 0;
    padding: 6px 0;
    overflow-y: auto;
    list-style: none;
}

.el-phone-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    font-size: 15px;
    color: var(--el-color-navy);
    cursor: pointer;
}

.el-phone-list li[hidden] {
    display: none;
}

.el-phone-list li:hover,
.el-phone-list li.is-active {
    background: var(--el-color-light);
}

.el-phone-list li[aria-selected="true"] {
    font-weight: 600;
}

.el-phone-list .el-phone-empty {
    color: #6b7a88;
    cursor: default;
}

.el-phone-name {
    flex: 1;
}

.el-phone-dial {
    color: #6b7a88;
}

.el-lead-turnstile {
    min-height: 65px;
}

/* Sentence case, as typed ("Send message"): one button label style site-wide (Dev fixes item 8) */
.el-lead-submit {
    margin-top: 6px;
    background: var(--el-color-navy);
}

.el-lead-submit[disabled] {
    opacity: 0.6;
    cursor: wait;
}

.el-lead-status {
    margin: 14px 0 0;
    font-size: 16px;
}

.el-lead-status:empty {
    display: none;
}

.el-lead-status.is-error {
    color: #c0392b;
}

.el-lead-status.is-success {
    color: #1e7a4c;
}

/* Reply promise, then the privacy note (both forms) */
.el-lead-reply {
    margin: 14px 0 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--el-color-navy);
}

.el-lead-reply + .el-lead-privacy {
    margin-top: 4px;
}

.el-lead-privacy {
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: #6b7a88;
}

.el-lead-privacy a {
    color: inherit;
    text-decoration: underline;
}

/* Hidden from people; bots fill it in. */
.el-lead-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Thank-you popup with confetti (opened by lead-form.js after a successful send) */
.el-thanks {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
}

.el-thanks[hidden] {
    display: none;
}

.el-thanks-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 29, 39, 0.7);
    backdrop-filter: blur(6px);
}

.el-thanks-card {
    position: relative;
    width: min(480px, 100%);
    padding: 40px 32px 32px;
    border-radius: 24px;
    background: var(--el-color-white);
    color: var(--el-color-navy);
    text-align: center;
    box-shadow: 0 28px 56px rgba(12, 29, 39, 0.35);
    animation: el-thanks-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.el-thanks-check {
    display: block;
    margin: 0 auto 16px;
    stroke: var(--el-color-orange);
}

.el-thanks-check-circle {
    stroke-dasharray: 152;
    stroke-dashoffset: 152;
    animation: el-thanks-draw 0.6s ease-out 0.15s forwards;
}

.el-thanks-check-path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: el-thanks-draw 0.4s ease-out 0.55s forwards;
}

.el-thanks-title {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.15;
}

.el-thanks-text {
    margin: 0 0 24px;
    font-size: 17px;
    line-height: 1.5;
    color: #2b4560;
}

.el-thanks-close {
    min-width: 160px;
}

/* Confetti bursts from the middle of the card; pieces are added by lead-form.js. */
.el-confetti {
    position: absolute;
    top: 40%;
    left: 50%;
    z-index: 5;
    pointer-events: none;
}

.el-confetti-piece {
    position: absolute;
    width: 10px;
    height: 14px;
    border-radius: 2px;
    background: var(--bg);
    opacity: 0;
    animation: el-confetti-boom var(--dur) cubic-bezier(0.25, 0.46, 0.45, 0.94) var(--delay) forwards;
}

.el-confetti-piece.is-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.el-confetti-piece.is-strip {
    width: 4px;
    height: 16px;
}

.el-thanks-open {
    overflow: hidden;
}

@keyframes el-thanks-pop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.96);
    }
}

@keyframes el-thanks-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes el-confetti-boom {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(0) scale(0);
    }

    8% {
        opacity: 1;
        transform: translate(0, 0) rotate(0) scale(var(--scale));
    }

    100% {
        opacity: 0;
        transform: translate(var(--x), var(--y)) rotate(var(--rot)) scale(var(--scale));
    }
}

@media (prefers-reduced-motion: reduce) {
    .el-thanks-card,
    .el-thanks-check-circle,
    .el-thanks-check-path {
        animation: none;
        stroke-dashoffset: 0;
    }

    .el-confetti {
        display: none;
    }
}

@media (max-width: 767px) {
    .el-lead-submit {
        width: 100%;
    }

    .el-thanks-card {
        padding: 32px 20px 24px;
    }

    .el-thanks-title {
        font-size: 26px;
    }
}
