/* ── EC WhatsApp Widget v1.0.1 – Frontend ── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@700;800&display=swap');

#ecwa-widget-root {
    --ecwa-green: #25D366;
    --ecwa-dark: #075E54;
    --ecwa-teal: #128C7E;
    --ecwa-bg: #0a1628;
    --ecwa-card: #111d35;
    --ecwa-text: #f1f5f9;
    --ecwa-text-sec: #94a3b8;
    --ecwa-text-muted: #64748b;
    --ecwa-border: rgba(255,255,255,0.08);
}

/* Reset within widget */
#ecwa-widget-root,
#ecwa-widget-root * {
    box-sizing: border-box;
    line-height: normal;
}

/* ── FAB ── */
#ecwa-widget-root .ecwa-fab {
    position: fixed !important;
    bottom: 28px !important;
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
    border-radius: 50% !important;
    background-color: var(--ecwa-green) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 6px 24px rgba(37,211,102,0.45), 0 2px 8px rgba(0,0,0,0.2) !important;
    z-index: 2147483646 !important;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease, opacity 0.4s ease !important;
    animation: ecwa-pulse 2.5s ease-in-out infinite !important;
    opacity: 0 !important;
    pointer-events: none !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    text-decoration: none !important;
    overflow: visible !important;
}
#ecwa-widget-root .ecwa-fab.ecwa-visible {
    opacity: 1 !important;
    pointer-events: auto !important;
}
#ecwa-widget-root .ecwa-fab.ecwa-right { right: 28px !important; }
#ecwa-widget-root .ecwa-fab.ecwa-left  { left: 28px !important; }
#ecwa-widget-root .ecwa-fab:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 8px 32px rgba(37,211,102,0.55), 0 4px 12px rgba(0,0,0,0.25) !important;
}

/* Icons inside FAB */
#ecwa-widget-root .ecwa-fab .ecwa-icon-wa,
#ecwa-widget-root .ecwa-fab .ecwa-icon-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    line-height: 0;
}
#ecwa-widget-root .ecwa-fab .ecwa-icon-wa { display: flex; }
#ecwa-widget-root .ecwa-fab .ecwa-icon-close { display: none; }

/* Force SVG visibility */
#ecwa-widget-root .ecwa-fab svg {
    display: block !important;
    width: auto !important;
    height: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}
#ecwa-widget-root .ecwa-fab svg path {
    fill: #ffffff !important;
}

@keyframes ecwa-pulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(37,211,102,0.45), 0 0 0 0 rgba(37,211,102,0.3); }
    50% { box-shadow: 0 6px 24px rgba(37,211,102,0.45), 0 0 0 14px rgba(37,211,102,0); }
}

/* ── PANEL ── */
#ecwa-widget-root .ecwa-panel {
    position: fixed !important;
    bottom: 104px !important;
    width: 380px !important;
    max-height: 580px !important;
    background: var(--ecwa-bg) !important;
    border-radius: 20px !important;
    box-shadow: 0 12px 48px rgba(0,0,0,0.45), 0 4px 16px rgba(0,0,0,0.3) !important;
    z-index: 2147483645 !important;
    overflow: hidden !important;
    transform: scale(0.85) translateY(20px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease !important;
    font-family: 'DM Sans', -apple-system, sans-serif !important;
    padding: 0 !important;
    margin: 0 !important;
}
#ecwa-widget-root .ecwa-panel.ecwa-right { right: 28px !important; transform-origin: bottom right; }
#ecwa-widget-root .ecwa-panel.ecwa-left  { left: 28px !important;  transform-origin: bottom left; }
#ecwa-widget-root .ecwa-panel.ecwa-visible {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Header */
#ecwa-widget-root .ecwa-header {
    background: linear-gradient(135deg, var(--ecwa-dark), var(--ecwa-teal)) !important;
    padding: 22px 24px !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
}
#ecwa-widget-root .ecwa-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.2);
}
#ecwa-widget-root .ecwa-header-text h3 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    letter-spacing: -0.3px;
}
#ecwa-widget-root .ecwa-header-text p {
    font-size: 12px !important;
    color: rgba(255,255,255,0.7) !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
}

/* Body */
#ecwa-widget-root .ecwa-body {
    padding: 20px 22px 24px;
    overflow-y: auto;
    max-height: 430px;
}

/* Progress */
#ecwa-widget-root .ecwa-progress {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
}
#ecwa-widget-root .ecwa-progress-dot {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: var(--ecwa-border);
    transition: background 0.4s ease;
}
#ecwa-widget-root .ecwa-progress-dot.ecwa-active { background: var(--ecwa-green); }
#ecwa-widget-root .ecwa-progress-dot.ecwa-done   { background: var(--ecwa-teal); }

/* Steps */
#ecwa-widget-root .ecwa-step {
    display: none;
    animation: ecwa-step-in 0.35s ease-out;
}
#ecwa-widget-root .ecwa-step.ecwa-active { display: block; }

@keyframes ecwa-step-in {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

#ecwa-widget-root .ecwa-step-label {
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    color: var(--ecwa-green) !important;
    margin-bottom: 6px !important;
}
#ecwa-widget-root .ecwa-step-title {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    color: var(--ecwa-text) !important;
    margin-bottom: 16px !important;
    letter-spacing: -0.5px;
    line-height: 1.2 !important;
}

/* Inputs */
#ecwa-widget-root .ecwa-input {
    width: 100% !important;
    padding: 14px 16px !important;
    background: var(--ecwa-card) !important;
    border: 1.5px solid var(--ecwa-border) !important;
    border-radius: 12px !important;
    color: var(--ecwa-text) !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 15px !important;
    outline: none !important;
    transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
    margin-bottom: 12px !important;
    -webkit-appearance: none !important;
}
#ecwa-widget-root .ecwa-input::placeholder { color: var(--ecwa-text-muted) !important; }
#ecwa-widget-root .ecwa-input:focus {
    border-color: var(--ecwa-green) !important;
    box-shadow: 0 0 0 3px rgba(37,211,102,0.15) !important;
}

/* Options */
#ecwa-widget-root .ecwa-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}
#ecwa-widget-root .ecwa-option {
    padding: 14px 18px !important;
    background: var(--ecwa-card) !important;
    border: 1.5px solid var(--ecwa-border) !important;
    border-radius: 12px !important;
    color: var(--ecwa-text) !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}
#ecwa-widget-root .ecwa-option:hover {
    border-color: rgba(37,211,102,0.4) !important;
    background: rgba(37,211,102,0.05) !important;
}
#ecwa-widget-root .ecwa-option.ecwa-selected {
    border-color: var(--ecwa-green) !important;
    background: rgba(37,211,102,0.1) !important;
}
#ecwa-widget-root .ecwa-option-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
#ecwa-widget-root .ecwa-option-label { font-weight: 600 !important; }
#ecwa-widget-root .ecwa-option-desc { font-size: 12px !important; color: var(--ecwa-text-muted) !important; margin-top: 2px; }

/* Select */
#ecwa-widget-root .ecwa-select {
    width: 100% !important;
    padding: 14px 40px 14px 16px !important;
    background-color: var(--ecwa-card) !important;
    border: 1.5px solid var(--ecwa-border) !important;
    border-radius: 12px !important;
    color: var(--ecwa-text) !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 15px !important;
    outline: none !important;
    cursor: pointer !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    margin-bottom: 12px !important;
}
#ecwa-widget-root .ecwa-select:focus {
    border-color: var(--ecwa-green) !important;
    box-shadow: 0 0 0 3px rgba(37,211,102,0.15) !important;
}
#ecwa-widget-root .ecwa-select option { background: var(--ecwa-bg); color: var(--ecwa-text); }

/* Buttons */
#ecwa-widget-root .ecwa-btn {
    width: 100% !important;
    padding: 14px !important;
    border: none !important;
    border-radius: 12px !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    margin-top: 6px !important;
    text-align: center !important;
    text-decoration: none !important;
    outline: none !important;
}
#ecwa-widget-root .ecwa-btn-primary {
    background: var(--ecwa-green) !important;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(37,211,102,0.3) !important;
}
#ecwa-widget-root .ecwa-btn-primary:hover {
    filter: brightness(1.08) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(37,211,102,0.4) !important;
}
#ecwa-widget-root .ecwa-btn-back {
    background: transparent !important;
    color: var(--ecwa-text-sec) !important;
    margin-top: 8px !important;
    font-size: 13px !important;
    box-shadow: none !important;
}
#ecwa-widget-root .ecwa-btn-back:hover { color: var(--ecwa-text) !important; }

/* Summary */
#ecwa-widget-root .ecwa-summary {
    background: var(--ecwa-card);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid var(--ecwa-border);
}
#ecwa-widget-root .ecwa-summary-title {
    font-size: 12px;
    color: var(--ecwa-green);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
#ecwa-widget-root .ecwa-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--ecwa-border);
}
#ecwa-widget-root .ecwa-summary-row:last-child { border-bottom: none; }
#ecwa-widget-root .ecwa-summary-label {
    font-size: 12px !important;
    color: var(--ecwa-text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
#ecwa-widget-root .ecwa-summary-value {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ecwa-text) !important;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

#ecwa-widget-root .ecwa-send-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
#ecwa-widget-root .ecwa-send-icon svg path {
    fill: #ffffff !important;
}

/* Shake */
@keyframes ecwa-shake {
    0%,100% { transform: translateX(0); }
    20%,60% { transform: translateX(-6px); }
    40%,80% { transform: translateX(6px); }
}
#ecwa-widget-root .ecwa-shake { animation: ecwa-shake 0.4s ease !important; }

/* ── Responsive ── */
@media (max-width: 440px) {
    #ecwa-widget-root .ecwa-panel {
        right: 12px !important;
        left: 12px !important;
        width: auto !important;
        bottom: 96px !important;
    }
    #ecwa-widget-root .ecwa-fab { bottom: 20px !important; }
    #ecwa-widget-root .ecwa-fab.ecwa-right { right: 20px !important; }
    #ecwa-widget-root .ecwa-fab.ecwa-left  { left: 20px !important; }
}
