/**
 * Meta Instant Form (Facebook Lead Ads Style) Stylesheet
 * 
 * High-Converting, Mobile-Native, Meta Ads Compliant
 * @package AmiDo_AlphaSoft
 */

/* ===== MODAL BACKDROP CONTAINER ===== */
.meta-instant-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: rgba(10, 15, 30, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.meta-instant-modal-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== MAIN CARD CONTAINER ===== */
.meta-instant-form-wrapper {
    width: 100%;
    box-sizing: border-box;
}

.meta-instant-modal-overlay .meta-instant-form-wrapper {
    max-width: 580px;
    max-height: 94vh;
    overflow-y: auto;
    border-radius: 24px;
    box-shadow: 0 25px 60px -12px rgba(24, 119, 242, 0.28), 0 12px 30px -8px rgba(0, 0, 0, 0.25);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.meta-instant-modal-overlay.is-active .meta-instant-form-wrapper {
    transform: translateY(0) scale(1);
}

.meta-if-card {
    background: var(--surface, #ffffff);
    color: var(--text, #0f172a);
    border: 1px solid var(--border-soft, #e2e8f0);
    border-radius: 24px;
    padding: clamp(20px, 4vw, 32px);
    position: relative;
    box-sizing: border-box;
}

/* Dark mode enhancements */
[data-theme="dark"] .meta-if-card {
    background: #141b2d;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* ===== HEADER ===== */
.meta-if-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.meta-if-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-if-avatar-wrap {
    position: relative;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
}

.meta-if-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1877f2;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.25);
}

.meta-if-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid var(--surface, #ffffff);
    animation: pulseOnline 2s infinite;
}

@keyframes pulseOnline {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.meta-if-brand-meta {
    display: flex;
    flex-direction: column;
}

.meta-if-brand-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text, #0f172a);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

.meta-verified-badge {
    color: #1877f2;
    font-size: 1rem;
    display: inline-flex;
}

.meta-if-brand-sub {
    font-size: 0.8rem;
    color: var(--muted, #64748b);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.meta-badge-tag {
    background: rgba(24, 119, 242, 0.1);
    color: #1877f2;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.meta-if-close-btn {
    background: var(--surface-2, #f1f5f9);
    border: 1px solid var(--border-soft, #e2e8f0);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted, #64748b);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.meta-if-close-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

/* ===== PROGRESS BAR ===== */
.meta-if-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(24, 119, 242, 0.12);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.meta-if-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1877f2, #6c3ce1, #00b894);
    transition: width 0.4s ease;
}

.meta-if-step-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--muted, #64748b);
    font-weight: 600;
    margin-bottom: 18px;
}

.meta-if-secure-pill {
    color: #10b981;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ===== SCREENS ===== */
.meta-if-screen {
    display: none;
    animation: fadeInScreen 0.3s ease;
}

.meta-if-screen.active {
    display: block;
}

@keyframes fadeInScreen {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.meta-if-screen-intro {
    margin-bottom: 18px;
}

.meta-if-heading {
    font-size: clamp(1.2rem, 3vw, 1.45rem);
    font-weight: 800;
    color: var(--text, #0f172a);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.meta-if-subheading {
    font-size: 0.9rem;
    color: var(--text-2, #475569);
    margin: 0;
    line-height: 1.5;
}

/* ===== SERVICE GRID ===== */
.meta-if-service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

@media (max-width: 540px) {
    .meta-if-service-grid {
        grid-template-columns: 1fr;
    }
}

.meta-if-service-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1.5px solid var(--border-soft, #e2e8f0);
    background: var(--surface-2, #f8fafc);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

[data-theme="dark"] .meta-if-service-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.meta-if-service-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.meta-if-service-card:hover {
    border-color: #1877f2;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.12);
}

.meta-if-service-card.active {
    border-color: #1877f2;
    background: rgba(24, 119, 242, 0.07);
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

.meta-if-service-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(24, 119, 242, 0.12);
    color: #1877f2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.meta-if-service-card.active .meta-if-service-icon {
    background: #1877f2;
    color: #ffffff;
}

.meta-if-service-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.meta-if-service-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text, #0f172a);
    line-height: 1.25;
}

.meta-if-service-desc {
    font-size: 0.74rem;
    color: var(--muted, #64748b);
    line-height: 1.35;
    margin-top: 2px;
}

.meta-if-radio-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-soft, #cbd5e1);
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.meta-if-service-card.active .meta-if-radio-dot {
    border-color: #1877f2;
    background: #1877f2;
}

.meta-if-service-card.active .meta-if-radio-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
}

/* ===== PILLS SECTION ===== */
.meta-if-pills-section {
    margin-bottom: 22px;
}

.meta-if-section-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text, #0f172a);
    margin-bottom: 8px;
}

.meta-if-chips-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-if-chip {
    background: var(--surface-2, #f1f5f9);
    border: 1px solid var(--border-soft, #e2e8f0);
    color: var(--text-2, #475569);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.meta-if-chip:hover {
    border-color: #1877f2;
    color: #1877f2;
}

.meta-if-chip.active {
    background: linear-gradient(135deg, #1877f2, #6c3ce1);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

/* ===== AUTOFILL HINT & SAVED PILL ===== */
.meta-if-autofill-hint {
    background: rgba(234, 67, 53, 0.07);
    border: 1px solid rgba(234, 67, 53, 0.18);
    color: var(--text, #0f172a);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.84rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.meta-if-saved-pill {
    background: rgba(108, 60, 225, 0.08);
    border: 1px solid rgba(108, 60, 225, 0.22);
    color: var(--primary, #6c3ce1);
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.84rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.meta-if-saved-pill button {
    background: var(--primary, #6c3ce1);
    color: #ffffff;
    border: none;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

/* ===== INPUT FIELDS ===== */
.meta-if-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

@media (max-width: 540px) {
    .meta-if-fields-grid {
        grid-template-columns: 1fr;
    }
}

.meta-if-field-group {
    display: flex;
    flex-direction: column;
}

.meta-if-field-group.full-width {
    grid-column: 1 / -1;
}

.meta-if-field-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text, #0f172a);
    margin-bottom: 6px;
}

.meta-if-field-group .req {
    color: #ef4444;
}

.meta-if-field-group .opt {
    color: var(--muted, #64748b);
    font-weight: normal;
}

.meta-if-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.meta-if-input-wrap i {
    position: absolute;
    left: 14px;
    color: var(--muted, #64748b);
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s;
}

.meta-if-input-wrap textarea + i {
    top: 14px;
}

.meta-if-input-wrap input,
.meta-if-input-wrap textarea {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border-radius: 12px;
    border: 1.5px solid var(--border-soft, #cbd5e1);
    background: var(--surface, #ffffff);
    color: var(--text, #0f172a);
    font-family: inherit;
    font-size: 0.94rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

[data-theme="dark"] .meta-if-input-wrap input,
[data-theme="dark"] .meta-if-input-wrap textarea {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.meta-if-input-wrap input:focus,
.meta-if-input-wrap textarea:focus {
    outline: none;
    border-color: #1877f2;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.15);
}

.meta-if-input-wrap input:focus + i,
.meta-if-input-wrap textarea:focus + i {
    color: #1877f2;
}

/* ===== PRIVACY NOTICE ===== */
.meta-if-privacy-notice {
    background: var(--surface-2, #f8fafc);
    border: 1px solid var(--border-soft, #e2e8f0);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.78rem;
    color: var(--text-2, #475569);
    line-height: 1.45;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
}

.meta-if-privacy-notice a {
    color: #1877f2;
    font-weight: 700;
    text-decoration: underline;
}

/* ===== BUTTONS ===== */
.meta-if-action-row {
    display: flex;
    gap: 12px;
}

.meta-if-action-row.split {
    justify-content: space-between;
}

.meta-if-btn-primary {
    flex: 1;
    background: linear-gradient(135deg, #1877f2, #6c3ce1);
    color: #ffffff;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.35);
}

.meta-if-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(24, 119, 242, 0.45);
}

.meta-if-btn-secondary {
    background: var(--surface-2, #f1f5f9);
    color: var(--text-2, #475569);
    border: 1px solid var(--border-soft, #cbd5e1);
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.meta-if-btn-secondary:hover {
    background: var(--border-soft, #e2e8f0);
}

/* ===== THANK YOU SCREEN ===== */
.meta-if-thankyou-box {
    text-align: center;
    padding: 10px 0;
}

.meta-if-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
    animation: bounceInSuccess 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.meta-if-submitted-badge {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 8px;
}

.meta-if-thankyou-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text, #0f172a);
    margin: 0 0 8px 0;
}

.meta-if-thankyou-desc {
    font-size: 0.92rem;
    color: var(--text-2, #475569);
    margin: 0 0 18px 0;
    line-height: 1.5;
}

.meta-if-ref-box {
    background: var(--surface-2, #f8fafc);
    border: 1px dashed #1877f2;
    padding: 12px 16px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
}

.meta-if-ref-label {
    font-size: 0.85rem;
    color: var(--muted, #64748b);
}

.meta-if-ref-code {
    font-size: 1.05rem;
    color: #1877f2;
    font-family: monospace;
    font-weight: 800;
}

/* CTA CARD */
.meta-if-cta-card {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1), rgba(16, 185, 129, 0.05));
    border: 1.5px solid rgba(37, 211, 102, 0.35);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 16px;
}

.meta-if-cta-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text, #0f172a);
    margin-bottom: 4px;
}

.meta-if-cta-sub {
    font-size: 0.82rem;
    color: var(--muted, #64748b);
    margin: 0 0 12px 0;
}

.meta-if-wa-btn {
    background: #25d366;
    color: #ffffff;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.96rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.3);
    transition: all 0.2s;
}

.meta-if-wa-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.45);
}

.meta-if-call-wrap {
    font-size: 0.84rem;
    color: var(--muted, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.meta-if-phone-link {
    color: var(--primary, #6c3ce1);
    font-weight: 700;
    text-decoration: none;
}

.meta-if-finish-btn {
    background: var(--surface-2, #f1f5f9);
    color: var(--text, #0f172a);
    border: 1px solid var(--border-soft, #cbd5e1);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s;
}

.meta-if-finish-btn:hover {
    background: var(--border-soft, #e2e8f0);
}

/* ===== AUDIT LANDING PAGE CARD ===== */
.audit-form-card {
    background: var(--surface, #ffffff);
    border: 1.5px solid var(--border-soft, #e2e8f0);
    border-radius: 24px;
    padding: clamp(22px, 4vw, 36px);
    box-shadow: 0 20px 50px -10px rgba(108, 60, 225, 0.18);
    transition: all 0.3s;
}

[data-theme="dark"] .audit-form-card {
    background: #141b2d;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.audit-form-card input:focus {
    outline: none;
    border-color: #1877f2 !important;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.18) !important;
}

#auditSubmitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(24, 119, 242, 0.45) !important;
}
