/* Contact Form Section - reusable on front page and service pages */

/* ========== Block: Contact Form Section ========== */
.contact-form-section {
    background: #0a0a0a;
    padding: 6rem 0;
    direction: rtl;
    position: relative;
    overflow: hidden;
}

.contact-form-section::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 107, 0, 0.08) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.contact-form-outer {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.contact-form-card {
    background: #fff;
    border-radius: 24px;
    padding: 3.5rem 3rem;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    position: relative;
}

/* Shortcode embed: transparent section, card matches .service-hero-form-card */
.contact-form-section--embed {
    background: transparent;
    padding: 2rem 0;
    overflow: visible;
}

.contact-form-section--embed::before {
    display: none;
}

.contact-form-section--embed .contact-form-card {
    border-radius: 24px;
    border: none;
    background: #f9f9f9;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.06), 0 12px 48px rgba(0, 0, 0, 0.05);
    padding: 2.5rem;
}

/* Embed inside page content: avoid double horizontal gutter (.page-content padding + .contact-form-outer 20px) */
.page-content .contact-form-section--embed .contact-form-outer {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.contact-form-header {
    text-align: center;
    margin-bottom: 2.75rem;
}

.contact-form-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #111;
    margin: 0 0 0.75rem;
    line-height: 1.35;
}

.contact-form-header p {
    font-size: 1rem;
    color: #888;
    margin: 0;
    line-height: 1.6;
}

.contact-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.contact-form-grid .full-width {
    grid-column: 1 / -1;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-field label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #222;
    background: #fafafa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    direction: rtl;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #bbb;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--primary-color, #ff6b00);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
    background: #fff;
}

.form-field select {
    cursor: pointer;
    color: #222;
}

.form-field select.placeholder-active {
    color: #bbb;
}

.form-field select.placeholder-active option {
    color: #222;
}

.form-field select.placeholder-active option:disabled {
    color: #bbb;
}

.form-field textarea {
    min-height: 120px;
    resize: vertical;
}

.form-field input.form-input-ltr,
.form-field input[dir="ltr"].form-input-ltr {
    text-align: left;
}

.phone-field-group {
    display: flex;
    gap: 0;
    direction: ltr;
}

.phone-country-select {
    position: relative;
    flex-shrink: 0;
}

.phone-country-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.85rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 10px 0 0 10px;
    background: #f4f4f4;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    font-family: inherit;
    height: 100%;
    white-space: nowrap;
    transition: border-color 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
    min-width: 100px;
    justify-content: center;
}

.phone-country-btn:hover {
    background: #eee;
}

.phone-country-btn .country-flag {
    font-size: 1.2rem;
    line-height: 1;
}

.phone-country-btn .country-code {
    font-weight: 600;
    font-size: 0.88rem;
    direction: ltr;
    font-family: 'Inter', sans-serif;
}

.phone-country-btn .dropdown-arrow {
    font-size: 0.75rem;
    color: #555;
    margin-right: 2px;
}

.phone-country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}

.phone-country-dropdown.open {
    display: block;
}

.phone-country-dropdown .country-search {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.88rem;
    outline: none;
    font-family: inherit;
    direction: rtl;
    box-sizing: border-box;
}

.phone-country-dropdown .country-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.15s ease;
    direction: ltr;
}

.phone-country-dropdown .country-option:hover {
    background: #f6f6f6;
}

.phone-country-dropdown .country-option .country-flag {
    font-size: 1.15rem;
}

.phone-country-dropdown .country-option .country-name {
    flex: 1;
    color: #444;
}

.phone-country-dropdown .country-option .country-dial {
    color: #999;
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
}

.phone-field-group input[type="tel"] {
    border-radius: 0 10px 10px 0;
    border-right: none;
    flex: 1;
    direction: ltr;
    text-align: left;
    min-width: 0;
}

.phone-field-group input[type="tel"]:focus {
    border-color: var(--primary-color, #ff6b00);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
    background: #fff;
}

.phone-field-group:focus-within .phone-country-btn {
    border-color: var(--primary-color, #ff6b00);
    background: #fff;
}

.contact-form-submit {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--primary-color, #ff6b00);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    margin-top: 0.5rem;
}

.contact-form-submit:hover {
    background: var(--primary-color-dark, #e05a00);
    transform: translateY(-1px);
}

.contact-form-submit:active {
    transform: translateY(0);
}

.form-field .just-validate-error-label {
    color: #e53935;
    font-size: 0.72rem;
    margin-top: 5px;
    font-weight: 500;
    display: block;
    text-align: left;
}

.form-field input.just-validate-error-field,
.form-field select.just-validate-error-field,
.form-field textarea.just-validate-error-field {
    border-color: #e53935 !important;
}

.form-global-error {
    display: none;
    text-align: left;
    color: #e53935;
    font-size: 0.72rem;
    font-weight: 500;
    margin-top: 12px;
}

.form-global-error.visible {
    display: block;
}

.form-success-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: #fff;
    border-radius: inherit;
    z-index: 10;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    animation: contactFormFadeInOverlay 0.4s ease;
}

.form-success-overlay.visible {
    display: flex;
}

@keyframes contactFormFadeInOverlay {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-success-content {
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-success-icon {
    margin-bottom: 1.5rem;
}

.form-success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 0.75rem;
}

.form-success-desc {
    font-size: 1rem;
    color: #666;
    line-height: 1.8;
}

.spinner-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: contactFormSpin 0.8s ease-in-out infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes contactFormSpin {
    to {
        transform: rotate(360deg);
    }
}

.fp-scroll-anchor {
    scroll-margin-top: 90px;
}

@media (max-width: 768px) {
    .contact-form-section {
        padding: 4rem 0;
    }

    .contact-form-section--embed {
        padding: 1.5rem 0;
    }

    .contact-form-section--embed .contact-form-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .contact-form-card {
        padding: 2.5rem 1.5rem;
        border-radius: 20px;
    }

    .contact-form-header h2 {
        font-size: 1.6rem;
    }

    .contact-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .contact-form-section {
        padding: 3rem 0;
    }

    .contact-form-section--embed {
        padding: 1.25rem 0;
    }

    .contact-form-section--embed .contact-form-card {
        padding: 1.75rem 1.25rem;
        border-radius: 16px;
    }

    .contact-form-card {
        padding: 2rem 1.25rem;
        border-radius: 16px;
    }

    .contact-form-header {
        margin-bottom: 2rem;
    }

    .contact-form-header h2 {
        font-size: 1.4rem;
    }

    .contact-form-header p {
        font-size: 0.92rem;
    }
}
