/* FIELD ASTERISK (design system version) */
.custom-form .field-asterisk {
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

/* UNIFIED FIELD HEIGHT — applies to inputs AND custom select */
.custom-form {
    --field-height: 44px;
}

.custom-form input[type="text"],
.custom-form input[type="email"],
.custom-form input[type="tel"],
.custom-form .custom-select-selected {
    width: 100%;
    height: var(--field-height);
    padding: 0 0.9rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.9rem;
    line-height: var(--field-height);
    color: #333;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    display: flex;
    align-items: center;
}

.custom-form textarea {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    min-height: 130px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

/* Focus state */
.custom-form input[type="text"]:focus,
.custom-form input[type="email"]:focus,
.custom-form input[type="tel"]:focus,
.custom-form textarea:focus {
    border-color: #199caa;
    box-shadow: 0 0 0 3px rgba(25, 156, 170, 0.12);
}

/* Placeholder */
.custom-form input[type="text"]::placeholder,
.custom-form input[type="email"]::placeholder,
.custom-form input[type="tel"]::placeholder,
.custom-form textarea::placeholder {
    color: #a0a0a0;
}

/* CUSTOM SELECT DROPDOWN */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-selected {
    cursor: pointer;
    padding-right: 2.5rem;
    color: #333;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.custom-select-selected.placeholder {
    color: #a0a0a0;
}

/* Chevron — angle-down by default */
.custom-select-selected::after {
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #747474;
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

/* Chevron — angle-up when open */
.custom-select-wrapper.open .custom-select-selected::after {
    content: "\f106";
    color: #199caa;
}

.custom-select-wrapper.open .custom-select-selected {
    border-color: #199caa;
    box-shadow: 0 0 0 3px rgba(25, 156, 170, 0.12);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Dropdown options panel */
.custom-select-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #199caa;
    border-top: none;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    z-index: 50;
    max-height: 240px;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(25, 156, 170, 0.1);
}

.custom-select-wrapper.open .custom-select-options {
    display: block;
}

.custom-select-options div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    border-bottom: 1px solid #eee;
    transition: background 0.15s ease, color 0.15s ease;
}

.custom-select-options div:last-child {
    border-bottom: none;
}

.custom-select-options div:hover {
    background: #199caa;
    color: #fff;
}

/* Flag size inside options (for country select) */
.custom-select-options .fi {
    width: 20px;
    height: auto;
}

/* RTL support for custom select */
html[lang="ar"] .custom-select-selected {
    padding-right: 0.9rem;
    padding-left: 2.5rem;
    text-align: right;
    direction: rtl;
}

html[lang="ar"] .custom-select-selected::after {
    right: auto;
    left: 0.9rem;
}

html[lang="ar"] .custom-select-options {
    direction: rtl;
    text-align: right;
}

/* WARNING MESSAGES (design system version) */
.custom-form .cf7-warning {
    display: none;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #dc3545;
    line-height: 1.3;
}

/* Empty / invalid field highlight */
.custom-form input.is-empty-invalid,
.custom-form textarea.is-empty-invalid,
.custom-form .wpcf7-not-valid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12) !important;
}

.custom-form .custom-select-wrapper.is-empty-invalid .custom-select-selected {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

/* SUBMIT BUTTON */
/* #199caa enabled / #148094 active / disabled shows ban icon */
#btncf {
    margin-top: 1rem;
    text-align: center;
    position: relative;
    display: block;
}

.custom-form .wpcf7-submit,
#btncf input[type="submit"] {
    position: relative;
    min-width: 180px;
    height: 48px;
    padding: 0 36px;
    background: #199caa;
    color: #fff;
    border: 1.5px solid #199caa;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    overflow: hidden;
    transition: background-color 0.25s ease,
                border-color 0.25s ease,
                color 0.25s ease,
                transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Hover/focus/active — only when ENABLED */
.custom-form .wpcf7-submit:not(.is-disabled):hover,
.custom-form .wpcf7-submit:not(.is-disabled):focus,
.custom-form .wpcf7-submit:not(.is-disabled):focus-visible,
.custom-form .wpcf7-submit:not(.is-disabled):active,
#btncf input[type="submit"]:not(.is-disabled):hover,
#btncf input[type="submit"]:not(.is-disabled):focus,
#btncf input[type="submit"]:not(.is-disabled):focus-visible,
#btncf input[type="submit"]:not(.is-disabled):active {
    background: #148094;
    border-color: #148094;
    color: #fff;
    outline: none;
}

.custom-form .wpcf7-submit:not(.is-disabled):active,
#btncf input[type="submit"]:not(.is-disabled):active {
    transform: scale(0.98);
}

/* Disabled state */
.custom-form .wpcf7-submit.is-disabled,
#btncf input[type="submit"].is-disabled {
    background: #199caa;
    border-color: #199caa;
    color: #fff;
    cursor: not-allowed;
    pointer-events: auto;
    transform: none;
    opacity: 0.85;
}

/* Disabled — hover/touch hides text so ban icon shows */
.custom-form .wpcf7-submit.is-disabled:hover,
.custom-form .wpcf7-submit.is-disabled.is-touched,
#btncf input[type="submit"].is-disabled:hover,
#btncf input[type="submit"].is-disabled.is-touched {
    color: transparent;
    background: #148094;
    border-color: #148094;
    opacity: 1;
}

/* Ban icon overlay (positioned by #btncf since input can't have ::before) */
#btncf::after {
    content: "\f05e";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    font-size: 1.4rem;
    color: red;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#btncf:has(.is-disabled:hover)::after,
#btncf:has(.is-disabled.is-touched)::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Loading state */
.custom-form .wpcf7-submit.is-loading,
#btncf input[type="submit"].is-loading {
    color: transparent !important;
    pointer-events: none;
    background: #148094 !important;
    border-color: #148094 !important;
}

#btncf:has(.is-loading)::after {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 1;
    transform: translate(-50%, -50%);
    animation: btn-spin 0.7s linear infinite;
    color: transparent;
    background: transparent;
}

@keyframes btn-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .custom-form {
        --field-height: 42px;
    }
    .custom-form .wpcf7-submit,
    #btncf input[type="submit"] {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .custom-form {
        --field-height: 40px;
    }
    .custom-form textarea {
        min-height: 110px;
    }
}

/* CONTAINER SPACING (design system version — overrides base) */
.custom-form .input-container {
    margin-bottom: 1rem;
    width: 100%;
}

.custom-form .input-icon-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.custom-form .field-title {
    font-size: 0.875rem;
    color: #333;
    margin: 0 0 0.4rem 0;
    font-weight: 500;
}