/* ================================================================
   MEDENTICA QUATTROCONE — SMART CLINIC
   conversion.css — Phase 4: Conversion, SEO & Analytics
   Loaded after animations.css — no conflicts.
   ================================================================ */


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   § 1 · TRUST / SOCIAL PROOF STRIP
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.section-trust {
    padding-block: 2.5rem;
    background: var(--c-bg-surface);
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    position: relative;
    overflow: hidden;
}

.section-trust::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 60% 100% at 50% 50%, rgba(225,6,0,0.04), transparent);
    pointer-events: none;
}

.trust-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    position: relative;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 2rem;
    border-right: 1px solid var(--c-border);
    transition: background var(--dur-base);
}

.trust-item:last-child { border-right: none; }
.trust-item:hover { background: rgba(255,255,255,0.025); }

.trust-icon {
    flex-shrink: 0;
    width: 48px; height: 48px;
    display: grid; place-items: center;
    background: var(--c-red-dim);
    border: 1px solid rgba(225,6,0,0.2);
    border-radius: var(--r-md);
    font-size: 1.375rem;
    line-height: 1;
}

.trust-text { display: flex; flex-direction: column; gap: 0.2rem; }

.trust-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--c-white);
    letter-spacing: -0.03em;
    line-height: 1;
}

.trust-label {
    font-size: var(--t-xs);
    color: var(--c-muted);
    line-height: 1.4;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   § 2 · INLINE MID-PAGE CTA STRIP
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.section-inline-cta {
    padding-block: 3.5rem;
    background: var(--c-bg-alt);
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
}

.inline-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.inline-cta-text {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.inline-cta-headline {
    font-family: var(--f-fa);
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: var(--c-white);
    direction: rtl;
}

.inline-cta-sub {
    font-size: var(--t-sm);
    color: var(--c-muted);
}

.inline-cta-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   § 3 · CONSULTATION FORM SECTION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.section-consultation {
    padding-block: var(--sp-section);
    background: var(--c-bg);
    position: relative;
}

.section-consultation::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 80% 80% at 30% 50%, rgba(93,225,255,0.03), transparent 60%);
    pointer-events: none;
}

.consult-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: start;
}

/* Left: copy + benefits */
.consult-copy {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.consult-benefits {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: var(--t-sm);
    color: var(--c-muted);
}

.benefit-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--c-cyan);
    box-shadow: 0 0 8px var(--c-cyan-glow);
    flex-shrink: 0;
}

/* Right: form card */
.consult-form-card {
    padding: 2.5rem;
    direction: rtl;
}

.consult-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Field group */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-family: var(--f-fa);
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--c-white);
}

.form-label .form-required {
    color: var(--c-red);
    margin-right: 2px;
}

.form-input,
.form-textarea {
    font-family: var(--f-fa);
    font-size: var(--t-base);
    color: var(--c-white);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 0.875rem 1.125rem;
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
    outline: none;
    width: 100%;
    direction: rtl;
    -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--c-faint);
    font-family: var(--f-fa);
}

.form-input:focus,
.form-textarea:focus {
    border-color: rgba(93,225,255,0.4);
    box-shadow: 0 0 0 3px rgba(93,225,255,0.08);
    background: rgba(255,255,255,0.07);
}

.form-input.error,
.form-textarea.error {
    border-color: rgba(225,6,0,0.5);
    box-shadow: 0 0 0 3px rgba(225,6,0,0.08);
}

.form-input[type="tel"] { direction: ltr; text-align: right; }

.form-textarea {
    resize: vertical;
    min-height: 88px;
    line-height: 1.6;
}

/* Radio group */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--f-fa);
    font-size: var(--t-sm);
    color: var(--c-muted);
    cursor: pointer;
    padding: 0.5rem 1rem;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    transition: all var(--dur-fast);
}

.radio-option input[type="radio"] {
    accent-color: var(--c-red);
    width: 16px; height: 16px;
    cursor: pointer;
}

.radio-option:hover,
.radio-option:has(input:checked) {
    border-color: rgba(225,6,0,0.4);
    background: var(--c-red-dim);
    color: var(--c-white);
}

/* Submit button */
.form-submit {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading state */
.form-submit .btn-spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.form-submit.loading .btn-spinner { display: block; }
.form-submit.loading .btn-label  { display: none; }

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

/* Success state */
.form-success {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
    padding: 1.5rem 0;
    font-family: var(--f-fa);
    direction: rtl;
}

.form-success.visible { display: flex; }
.consult-form.hidden  { display: none;  }

.success-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(34,197,94,0.12);
    border: 2px solid rgba(34,197,94,0.3);
    display: grid; place-items: center;
    font-size: 1.75rem;
}

.success-title {
    font-size: var(--t-h3);
    font-weight: 700;
    color: var(--c-white);
}

.success-text {
    font-size: var(--t-sm);
    color: var(--c-muted);
    line-height: 1.7;
}

/* Inline field error */
.field-error {
    font-family: var(--f-fa);
    font-size: var(--t-xs);
    color: #FC8181;
    direction: rtl;
    display: none;
}
.field-error.visible { display: block; }


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   § 4 · FAQ SECTION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.section-faq {
    padding-block: var(--sp-section);
    background: var(--c-bg-alt);
    direction: rtl;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 3rem;
    border-top: 1px solid var(--c-border);
}

.faq-item {
    border-bottom: 1px solid var(--c-border);
}

.faq-question {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.5rem 0;
    font-family: var(--f-fa);
    font-size: var(--t-base);
    font-weight: 600;
    color: var(--c-white);
    cursor: pointer;
    user-select: none;
    transition: color var(--dur-fast);
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question:hover { color: var(--c-white); }

.faq-question::after {
    content: '';
    flex-shrink: 0;
    width: 20px; height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%239AA4B2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
    transition: transform var(--dur-base) var(--ease-spring);
}

.faq-item[open] .faq-question::after {
    transform: rotate(180deg);
}

.faq-item[open] .faq-question {
    color: var(--c-white);
}

.faq-answer {
    font-family: var(--f-fa);
    font-size: var(--t-sm);
    color: var(--c-muted);
    line-height: 1.85;
    padding-bottom: 1.5rem;
    padding-right: 0;
    max-width: 68ch;
    direction: rtl;
}

/* Smooth open animation */
.faq-item:not([open]) .faq-answer {
    animation: faq-close 0.25s ease forwards;
}

.faq-item[open] .faq-answer {
    animation: faq-open 0.3s var(--ease-out) forwards;
}

@keyframes faq-open  { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform: translateY(0); } }
@keyframes faq-close { from { opacity:1; transform: translateY(0); }     to { opacity:0; transform: translateY(-8px); } }


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   § 5 · SEO CONTENT SECTION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.section-seo-content {
    padding-block: var(--sp-section);
    background: var(--c-bg);
    direction: rtl;
}

.seo-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 5rem;
    align-items: start;
}

.seo-article {
    font-family: var(--f-fa);
    direction: rtl;
}

.seo-article h3 {
    font-size: var(--t-h3);
    font-weight: 700;
    color: var(--c-white);
    margin-top: 2rem;
    margin-bottom: 0.875rem;
    letter-spacing: -0.01em;
}

.seo-article h3:first-child { margin-top: 0; }

.seo-article p {
    font-size: var(--t-sm);
    color: var(--c-muted);
    line-height: 1.9;
    margin-bottom: 1.25rem;
}

.seo-article strong { color: var(--c-white); font-weight: 600; }

.seo-article ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-block: 1rem;
}

.seo-article ul li {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    font-size: var(--t-sm);
    color: var(--c-muted);
    line-height: 1.7;
}

.seo-article ul li::before {
    content: '';
    flex-shrink: 0;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--c-red);
    margin-top: 0.45em;
}

/* Sidebar: quick facts card */
.seo-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.fact-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    font-family: var(--f-fa);
    direction: rtl;
}

.fact-card-title {
    font-size: var(--t-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-faint);
    direction: ltr;
    text-align: right;
}

.fact-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fact-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--t-sm);
    color: var(--c-muted);
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--c-border);
}

.fact-list-item:last-child { border-bottom: none; padding-bottom: 0; }

.fact-list-value {
    font-weight: 700;
    color: var(--c-white);
    direction: ltr;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   § 6 · WHATSAPP FLOATING BUTTON
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    left: 2rem;          /* LTR: left side */
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #25D366;
    color: #fff;
    border-radius: var(--r-full);
    padding: 0.875rem 1.375rem;
    font-family: var(--f-fa);
    font-size: var(--t-sm);
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 32px rgba(37,211,102,0.35);
    transition:
        transform  0.4s cubic-bezier(0.34,1.56,0.64,1),
        box-shadow 0.3s ease;
    /* Enter animation */
    animation: wa-enter 0.6s cubic-bezier(0.34,1.56,0.64,1) 3s both;
}

@keyframes wa-enter {
    from { transform: translateY(100px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.whatsapp-float:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 14px 40px rgba(37,211,102,0.45);
    color: #fff;
}

.whatsapp-icon {
    width: 22px; height: 22px;
    flex-shrink: 0;
}

/* Pulse dot indicator */
.whatsapp-float::before {
    content: '';
    position: absolute;
    top: -3px; right: -3px;
    width: 12px; height: 12px;
    background: #fff;
    border: 2px solid #25D366;
    border-radius: 50%;
    animation: wa-dot-pulse 2s ease-in-out infinite;
}

@keyframes wa-dot-pulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%       { transform: scale(1.3); opacity: 0.7; }
}

/* Collapse to icon-only on small screens */
@media (max-width: 480px) {
    .whatsapp-float {
        padding: 1rem;
        border-radius: 50%;
    }
    .whatsapp-label { display: none; }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   § 7 · RESPONSIVE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 1024px) {
    .consult-layout { grid-template-columns: 1fr; gap: 3rem; }
    .seo-layout     { grid-template-columns: 1fr; gap: 2.5rem; }
    .seo-sidebar    { position: static; }
    .trust-strip    { grid-template-columns: repeat(2, 1fr); }
    .trust-item:nth-child(2) { border-right: none; }
}

@media (max-width: 768px) {
    .trust-strip       { grid-template-columns: 1fr; }
    .trust-item        { border-right: none; border-bottom: 1px solid var(--c-border); padding: 1.25rem 1.5rem; }
    .trust-item:last-child { border-bottom: none; }

    .inline-cta-inner  { flex-direction: column; align-items: flex-start; }
    .inline-cta-actions { width: 100%; }
    .inline-cta-actions .btn { flex: 1; justify-content: center; }

    .consult-form-card { padding: 1.5rem; }
    .radio-group       { flex-direction: column; }

    .section-faq       { direction: rtl; }
}
