/* J.M Motors Contact Widget CSS */
:root {
    --jmm-primary: #e63946;
    /* Example brand color - adjust if needed */
    --jmm-secondary: #1d3557;
    --jmm-bg: #ffffff;
    --jmm-text: #333333;
    --jmm-gray: #f1f5f9;
    --jmm-border: #e2e8f0;
    --jmm-success: #10b981;
    --jmm-error: #ef4444;
    --jmm-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --jmm-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --jmm-z-index: 9999;
}

/* FAB */
.jmm-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--jmm-primary);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.4);
    cursor: pointer;
    z-index: var(--jmm-z-index);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.jmm-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(230, 57, 70, 0.5);
}

.jmm-fab svg {
    fill: white;
    width: 32px;
    height: 32px;
}

/* Modal Overlay */
.jmm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: var(--jmm-z-index);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.jmm-overlay.jmm-open {
    opacity: 1;
    visibility: visible;
}

/* Modal Card */
.jmm-modal {
    background: var(--jmm-bg);
    width: 100%;
    max-width: 400px;
    margin: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: var(--jmm-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--jmm-font);
    color: var(--jmm-text);
    max-height: 90vh;
}

@media (min-width: 640px) {
    .jmm-overlay {
        align-items: center;
        justify-content: center;
    }

    .jmm-modal {
        margin: 20px;
        border-radius: 16px;
        transform: scale(0.9);
        opacity: 0;
        width: 380px;
        position: fixed;
        bottom: 90px;
        right: 20px;
        transform-origin: bottom right;
    }
}

.jmm-overlay.jmm-open .jmm-modal {
    transform: translateY(0);
}

@media (min-width: 640px) {
    .jmm-overlay.jmm-open .jmm-modal {
        transform: scale(1);
        opacity: 1;
    }
}

/* Header */
.jmm-header {
    padding: 16px 20px;
    background-color: var(--jmm-secondary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jmm-title {
    font-weight: 600;
    font-size: 16px;
    margin: 0;
}

.jmm-close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    padding: 4px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jmm-close:hover {
    color: white;
}

/* Body */
.jmm-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

/* Steps */
.jmm-step {
    display: none;
    animation: jmm-fade-in 0.3s ease;
}

.jmm-step.jmm-active {
    display: block;
}

@keyframes jmm-fade-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jmm-step-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    color: var(--jmm-secondary);
}

/* Options (Language, Intent, Method) */
.jmm-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jmm-option-btn {
    background-color: var(--jmm-gray);
    border: 1px solid var(--jmm-border);
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    color: var(--jmm-text);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    text-align: left;
}

.jmm-option-btn:hover {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
}

.jmm-option-btn:active {
    transform: scale(0.98);
}

.jmm-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Form */
.jmm-form-group {
    margin-bottom: 16px;
}

.jmm-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.jmm-input,
.jmm-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--jmm-border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.jmm-input:focus,
.jmm-textarea:focus {
    outline: none;
    border-color: var(--jmm-secondary);
    box-shadow: 0 0 0 2px rgba(29, 53, 87, 0.1);
}

.jmm-textarea {
    resize: vertical;
    min-height: 80px;
}

.jmm-error-msg {
    color: var(--jmm-error);
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.jmm-input.jmm-invalid {
    border-color: var(--jmm-error);
}

/* Footer Navigation */
.jmm-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--jmm-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8fafc;
}

.jmm-btn-back {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 14px;
    padding: 8px;
    transition: color 0.2s;
}

.jmm-btn-back:hover {
    color: var(--jmm-text);
}

.jmm-btn-next {
    background-color: var(--jmm-secondary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.jmm-btn-next:hover {
    background-color: #2c4a75;
}

.jmm-btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading / Status */
.jmm-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.jmm-loading-overlay.jmm-show {
    opacity: 1;
    visibility: visible;
}

.jmm-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--jmm-border);
    border-top-color: var(--jmm-secondary);
    border-radius: 50%;
    animation: jmm-spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes jmm-spin {
    to {
        transform: rotate(360deg);
    }
}

.jmm-status-text {
    font-weight: 500;
    color: var(--jmm-text);
    text-align: center;
}

/* Hidden Utilities */
.jmm-hidden {
    display: none !important;
}