/**
 * Frontend styles for Comfortside Contact Form.
 * Seamlessly matches and enhances the Contact Form 7 aesthetics in Comfortside.
 */

.custom-contact-form.cs-contact-form-wrapper {
    font-family: inherit;
    color: #222;
    max-width: 440px;
    margin: 0;
    position: relative;
}

.cs-contact-form {
    display: flex;
    flex-direction: column;
}

/* ── Floating Label Field Wrappers ─────────────────────────────────────── */
.cs-contact-form .custom-field {
    position: relative;
    margin-bottom: 22px;
}

.cs-contact-form .custom-field input[type="text"],
.cs-contact-form .custom-field input[type="email"],
.cs-contact-form .custom-field input[type="tel"] {
    width: 100%;
    padding: 13px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    background: #ffffff;
    color: #222;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.4;
    outline: none;
    -webkit-appearance: none;
}

.cs-contact-form .custom-field input:focus {
    border-color: #2BC3D0 !important;
    box-shadow: 0 0 0 3px rgba(43, 195, 208, 0.15);
}

.cs-contact-form .custom-field.has-error input {
    border-color: #e53e3e !important;
    background-color: #fffaf0;
}

.cs-contact-form .custom-field label {
    position: absolute;
    top: 13px;
    left: 12px;
    background: #ffffff;
    color: #777;
    font-size: 14px;
    padding: 0 4px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

/* Floating behavior: on focus or when input has text */
.cs-contact-form .custom-field input:focus + label,
.cs-contact-form .custom-field input:not(:placeholder-shown) + label,
.cs-contact-form .custom-field label.active {
    top: -8px;
    left: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #2BC3D0;
}

.cs-contact-form .custom-field.has-error input:focus + label,
.cs-contact-form .custom-field.has-error label.active {
    color: #e53e3e;
}

/* ── Checkboxes ───────────────────────────────────────────────────────── */
.cs-contact-form .custom-checkbox,
.cs-contact-form .wpcf7-acceptance {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    margin: 14px 0 !important;
    line-height: 1.5;
    font-size: 14px;
    color: #333;
}

.cs-contact-form .custom-checkbox label,
.cs-contact-form .wpcf7-acceptance label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    cursor: pointer;
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
    color: #333;
}

.cs-contact-form input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin: 2px 0 0 0;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    flex-shrink: 0;
    box-sizing: border-box;
    outline: none;
}

.cs-contact-form input[type="checkbox"]:hover {
    border-color: #2BC3D0;
}

.cs-contact-form input[type="checkbox"]:checked {
    background: #2BC3D0;
    border-color: #2BC3D0;
}

.cs-contact-form input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cs-contact-form input[type="checkbox"]:focus {
    box-shadow: 0 0 0 2px rgba(43, 195, 208, 0.25);
}

.cs-contact-form .custom-checkbox a,
.cs-contact-form .wpcf7-acceptance a {
    color: #2BC3D0;
    text-decoration: underline;
    font-weight: 500;
}

.cs-contact-form .custom-checkbox a:hover,
.cs-contact-form .wpcf7-acceptance a:hover {
    color: #1999a4;
}

/* ── Disclaimer Text ─────────────────────────────────────────────────── */
.cs-contact-form .disclaimer-text,
.cs-contact-form .custom-terms {
    font-size: 12px;
    color: #777;
    margin: 16px 0 20px 0;
    line-height: 1.5;
}

/* ── Submit Button ───────────────────────────────────────────────────── */
.cs-contact-form .custom-buttons {
    margin-top: 10px;
}

.cs-contact-form .custom-submit,
.cs-contact-form .wpcf7-submit,
.cs-contact-form .cs-btn-submit {
    background: #2BC3D0;
    color: #ffffff;
    padding: 13px 36px;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    transition: all 0.25s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(43, 195, 208, 0.2);
    min-width: 140px;
    outline: none;
}

.cs-contact-form .custom-submit:hover,
.cs-contact-form .wpcf7-submit:hover,
.cs-contact-form .cs-btn-submit:hover {
    background: #1999a4;
    box-shadow: 0 4px 8px rgba(43, 195, 208, 0.3);
    transform: translateY(-1px);
}

.cs-contact-form .cs-btn-submit:disabled {
    background: #a0dce1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Captcha container */
.cs-captcha-wrap {
    margin: 14px 0 18px 0;
    display: block;
}

/* Spinner inside button */
.cs-btn-loader {
    display: none !important;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cs-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}

.cs-contact-form .cs-btn-submit.is-loading .cs-btn-loader {
    display: inline-block !important;
}

@keyframes cs-spin {
    to { transform: rotate(360deg); }
}

/* ── Response Output Messages ─────────────────────────────────────────── */
.cs-contact-form .cs-response-output,
.cs-contact-form .wpcf7-response-output {
    margin-top: 22px;
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    animation: cs-fade-in 0.3s ease;
    display: none;
}

.cs-contact-form .cs-response-output.cs-success,
.cs-contact-form .wpcf7-mail-sent-ok {
    display: block !important;
    background: #e6fffa;
    color: #047481;
    border: 1px solid #2BC3D0;
}

.cs-contact-form .cs-response-output.cs-error,
.cs-contact-form .wpcf7-validation-errors,
.cs-contact-form .wpcf7-mail-sent-ng {
    display: block !important;
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

@keyframes cs-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* After a successful send the used Turnstile token is reset out of sight. */
.cs-captcha-wrap.cs-captcha-hidden { display: none; }
