/**
 * Contact Form 7 forms: booking (calculator) and callback (home CTA).
 */

.wpcf7 form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field--wide {
    grid-column: 1 / -1;
}

.field__label {
    font-size: 15px;
    font-weight: 600;
}

.wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

.field__input {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    font-size: 16px;
    color: var(--c-ink);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-sm);
}

textarea.field__input {
    resize: vertical;
}

/* Phone with fixed +373 */
.phone-input {
    display: flex;
    align-items: stretch;
    min-width: 0;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-sm);
}

.phone-input:focus-within {
    outline: var(--focus);
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
}

.phone-input__prefix {
    display: flex;
    align-items: center;
    padding-left: 14px;
    font-weight: 600;
    color: var(--c-text-2);
}

.phone-input .wpcf7-form-control-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.phone-input__field {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px 10px 8px;
    font-size: 16px;
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
}

.phone-input__field:focus-visible {
    outline: none;
    box-shadow: none;
}

/* Consent checkbox (CF7 acceptance) */
.field--consent {
    font-size: 14px;
}

.field--consent .wpcf7-list-item {
    margin: 0;
}

.field--consent label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.field--consent input[type='checkbox'] {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--c-primary);
}

.form-note {
    font-size: 14px;
    color: var(--c-text-2);
}

/* Errors and responses */
.wpcf7-not-valid-tip {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--c-error);
}

.field__input[aria-invalid='true'],
.phone-input:has([aria-invalid='true']) {
    border-color: var(--c-error);
}

.wpcf7 form .wpcf7-response-output {
    margin: 0;
    padding: 10px 14px;
    font-size: 14px;
    border: 0;
    border-radius: var(--r-btn);
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output {
    color: var(--c-error);
    background: var(--c-note);
}

.wpcf7 form.sent .wpcf7-response-output {
    display: none;
}

.wpcf7-spinner {
    display: none;
}

.wpcf7 form.submitting .wpcf7-submit {
    opacity: 0.6;
    pointer-events: none;
}

.screen-reader-response {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.form-success {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    background: var(--c-aqua-soft);
    border-radius: var(--r-sm);
}

.form-success:focus {
    outline: none;
}

.form-success__title {
    font-size: 18px;
    font-weight: 600;
}

/* Callback form on the green CTA */
.callback-form form {
    gap: 10px;
}

.callback-form__row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.callback-form .phone-input {
    flex: 1 1 220px;
    min-height: 56px;
    border: 0;
}

.callback-form .phone-input__field {
    min-height: 56px;
    font-size: 17px;
    font-weight: 500;
}

.callback-form .phone-input__prefix {
    font-size: 17px;
}

.callback-form .btn {
    flex: 0 0 auto;
    min-height: 56px;
    border-radius: var(--r-sm);
}

.callback-form .field--consent {
    font-size: 13px;
    color: var(--c-surface);
}

.callback-form .field--consent a {
    color: var(--c-surface);
}

.callback-form .wpcf7-not-valid-tip {
    display: inline-block;
    padding: 2px 8px;
    background: var(--c-surface);
    border-radius: 6px;
}

.cta .form-success {
    color: var(--c-ink);
}
