/* ============================================
   CTA Popup Forms & Inline Forms — Stylesheet
   ============================================ */

/* ── Button Container ────────────────────────────────────────────────────── */
.cta-button-container {
    margin: 0;
}

/* ── CTA Buttons ─────────────────────────────────────────────────────────── */
.cta-quote-btn,
.cta-expert-btn {
    background-color: #662046;
    color: #fff;
    border: none;
    padding: 15px;
    font-size: 25px;
    font-weight: 700;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 0;
    min-width: 220px;
    text-transform: none;
    letter-spacing: 0.5px;
}

.cta-quote-btn:hover,
.cta-expert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
}

.cta-expert-btn {
    background-color: #717074;
}

/* ── Modal Backdrop ──────────────────────────────────────────────────────── */
.cta-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: ctaFadeIn 0.3s ease;
    backdrop-filter: blur(3px);
}

@keyframes ctaFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal Content Box ───────────────────────────────────────────────────── */
.cta-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: none;
    border-radius: 12px;
    width: 90%;
    max-width: 650px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: ctaSlideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes ctaSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* ── Close Button ────────────────────────────────────────────────────────── */
.cta-close {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
    z-index: 10;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.cta-close:hover,
.cta-close:focus {
    color: #fff;
    background-color: #662046;
    outline: none;
}

/* ── Modal Heading ───────────────────────────────────────────────────────── */
.cta-modal h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 28px;
    text-align: center;
    border-bottom: 3px solid #662046;
    padding-bottom: 10px;
    font-weight: 700;
}

/* ── Form Layout ─────────────────────────────────────────────────────────── */
.cta-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.half-width {
    flex: 1;
    min-width: 200px;
}

/* ── Labels ──────────────────────────────────────────────────────────────── */
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

/* ── Inputs / Selects / Textareas ────────────────────────────────────────── */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
    background-color: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #662046;
    box-shadow: 0 0 0 3px rgba(102, 32, 70, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
    opacity: 1;
}

/* ── Native Date Input ──────────────────────────────────────────────── */
.cta-date-input {
    cursor: pointer;
    color-scheme: light;
}

.cta-date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    filter: invert(16%) sepia(60%) saturate(600%) hue-rotate(290deg);
    width: 18px;
    height: 18px;
}

.cta-date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* ── Select ──────────────────────────────────────────────────────────────── */
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

/* ── Textarea ────────────────────────────────────────────────────────────── */
.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ── Checkbox Group ──────────────────────────────────────────────────────── */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 5px 0;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
    font-weight: normal !important;
    margin-bottom: 0 !important;
    background-color: #fff;
}

.checkbox-label:hover {
    border-color: #662046;
    background-color: rgba(102, 32, 70, 0.05);
    transform: translateX(2px);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #662046;
    padding: 0 !important;
    margin: 0;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: #662046;
    font-weight: bold;
}

.checkbox-label:has(input:checked) {
    border-color: #662046;
    background-color: rgba(102, 32, 70, 0.1);
}

.checkbox-label span {
    font-size: 15px;
    color: #333;
    line-height: 1.4;
}

/* ── Submit Button ───────────────────────────────────────────────────────── */
.cta-submit-btn {
    background: linear-gradient(135deg, #662046, #804666);
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(102, 32, 70, 0.3);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cta-submit-btn:hover {
    background: linear-gradient(135deg, #804666, #662046);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 32, 70, 0.4);
}

.cta-submit-btn:active {
    transform: translateY(0);
}

/* ── Inline Message Bar (errors / info) ──────────────────────────────────── */
.cta-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    display: none;
    animation: ctaSlideDown 0.3s ease;
}

@keyframes ctaSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0);     }
}

.cta-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cta-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ── Success Overlay (replaces form after successful submit) ─────────────── */
.cta-success-overlay {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    animation: ctaSuccessPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes ctaSuccessPop {
    0%   { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1);   }
}

.cta-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #28a745, #20c55e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.35);
    animation: ctaBounce 0.6s 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes ctaBounce {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.cta-success-title {
    color: #155724;
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 12px;
}

.cta-success-msg {
    color: #555;
    font-size: 16px;
    line-height: 1.6;
    max-width: 400px;
    margin: 0;
}

/* ── Loading State ───────────────────────────────────────────────────────── */
.cta-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.cta-submit-btn.loading {
    background: #6c757d;
    cursor: not-allowed;
    position: relative;
}

.cta-submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ctaSpin 0.8s linear infinite;
}

@keyframes ctaSpin {
    to { transform: rotate(360deg); }
}

/* ── Phone Input Group ───────────────────────────────────────────────────── */
.phone-input-group {
    display: flex;
    gap: 5px;
    width: 100%;
}

.phone-input-group .country-code-select {
    flex-shrink: 0;
    width: 110px;
    padding-right: 10px;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 28px;
}

.phone-input-group input[name="phone_number"] {
    flex-grow: 1;
}

/* =========================================================================
   GET IN TOUCH INLINE FORM (NEW)
   ========================================================================= */
.cta-get-in-touch-container {
    max-width: 800px;
    margin: 40px auto;
    font-family: inherit;
}

.get-in-touch-header {
    margin-bottom: 30px;
}

.get-in-touch-header h2 {
    font-size: 38px;
    color: #555b63;
    font-weight: 800;
    margin: 0 0 10px 0;
    border: none;
    text-align: left;
    padding: 0;
}

.get-in-touch-header p {
    font-size: 24px;
    color: #888;
    margin: 0;
}

/* Input Fields styling strictly for Get in touch matching image */
.get-in-touch-form .form-group input,
.get-in-touch-form .form-group select,
.get-in-touch-form .form-group textarea {
    padding: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
}

.get-in-touch-form .form-submit-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.get-in-touch-btn {
    background-color: #6a244b;
    background-image: none; /* override gradient */
    width: auto;
    padding: 16px 40px;
    font-size: 16px;
    letter-spacing: 1px;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: none;
}

.get-in-touch-btn:hover {
    background-color: #551b3a;
    background-image: none;
    box-shadow: none;
}

/* Success container layout inside the inline form */
.cta-get-in-touch-container .inline-success {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 50px 20px;
    border: 1px solid #ddd;
}

/* ── Responsive — Tablet ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .cta-modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }

    .cta-quote-btn,
    .cta-expert-btn {
        width: 100%;
        margin: 10px 0;
        padding: 12px 20px;
        font-size: 18px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .half-width {
        min-width: auto;
        width: 100%;
    }

    .cta-modal h2 {
        font-size: 24px;
    }

    .checkbox-group { gap: 6px; }
    .checkbox-label  { padding: 10px; }
    .checkbox-label span { font-size: 14px; }

    .phone-input-group {
        flex-direction: row;
        gap: 5px;
    }
}

/* ── Responsive — Mobile ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .cta-modal-content {
        margin: 5% auto;
        padding: 15px;
        max-width: 100%;
    }

    .cta-close {
        right: 15px;
        top: 10px;
        font-size: 24px;
    }

    .cta-modal h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .form-group { margin-bottom: 15px; }
    .form-group label { font-size: 13px; }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 16px;
    }

    .cta-submit-btn {
        padding: 12px 20px;
        font-size: 16px;
    }

    .checkbox-label { padding: 8px 10px; }
    .checkbox-label span { font-size: 13px; }

    .cta-success-icon  { width: 64px; height: 64px; font-size: 32px; }
    .cta-success-title { font-size: 22px; }
    .cta-success-msg   { font-size: 14px; }

    .phone-input-group {
        flex-direction: column;
        gap: 8px;
    }
    .phone-input-group .country-code-select,
    .phone-input-group input[name="phone_number"] {
        width: 100%;
    }
}

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
    .cta-modal { display: none !important; }
}

/* ── Focus / Accessibility ───────────────────────────────────────────────── */
.cta-quote-btn:focus,
.cta-expert-btn:focus,
.cta-submit-btn:focus {
    outline: 3px solid rgba(102, 32, 70, 0.5);
    outline-offset: 2px;
}

/* ── Reduced Motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .cta-modal,
    .cta-modal-content,
    .cta-quote-btn,
    .cta-expert-btn,
    .cta-submit-btn,
    .cta-message,
    .cta-success-overlay,
    .cta-success-icon {
        animation: none;
        transition: none;
    }
}

/* ── Smooth scroll ───────────────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}