/**
 * Motor Repair Form Styles
 * Popup version - positioned bottom right
 */

/* ========================================
   FLOATING TRIGGER BUTTON (Bottom Right)
   ======================================== */

.mrf-popup-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #00b4b4, #008080);
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 180, 180, 0.4);
    z-index: 9998;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.mrf-popup-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 180, 180, 0.5);
}

.mrf-popup-trigger.mrf-hidden {
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
}

.mrf-trigger-icon {
    font-size: 18px;
}

/* ========================================
   POPUP OVERLAY
   ======================================== */

.mrf-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mrf-popup-overlay.mrf-active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   POPUP CONTAINER (Bottom Right)
   ======================================== */

.mrf-popup-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.mrf-popup-container.mrf-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ========================================
   FORM WRAPPER
   ======================================== */

.mrf-form-wrapper {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px 30px 30px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 480px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* Close button */
.mrf-close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    color: #e74c3c;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-weight: 300;
    transition: color 0.2s ease;
}

.mrf-close-btn:hover {
    color: #c0392b;
}

/* Title */
.mrf-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-style: italic;
    padding-right: 30px;
}

/* Divider line */
.mrf-divider {
    height: 2px;
    background: linear-gradient(to right, #5dade2, #48c9b0);
    margin-bottom: 20px;
}

/* ========================================
   FORM ROWS
   ======================================== */

.mrf-form-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.mrf-form-row label {
    flex: 0 0 120px;
    text-align: right;
    padding-right: 15px;
    font-size: 14px;
    color: #555;
}

.mrf-required {
    color: #e74c3c;
}

.mrf-form-row input[type="text"],
.mrf-form-row input[type="email"],
.mrf-form-row input[type="tel"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s ease;
}

.mrf-form-row input:focus {
    outline: none;
    border-color: #5dade2;
}

/* ========================================
   CHECKBOX SECTION
   ======================================== */

.mrf-checkbox-section {
    margin: 20px 0;
}

.mrf-checkbox-intro {
    font-size: 13px;
    color: #5dade2;
    font-style: italic;
    margin-bottom: 12px;
    line-height: 1.5;
}

.mrf-checkbox-intro em {
    font-style: italic;
}

.mrf-checkbox-group {
    padding-left: 120px;
}

/* Checkbox styling */
.mrf-checkbox-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    position: relative;
    padding-right: 28px;
}

.mrf-checkbox-text {
    margin-right: 8px;
}

.mrf-checkbox-label input[type="checkbox"] {
    position: absolute;
    right: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #5dade2;
}

/* ========================================
   COMMENTS ROW
   ======================================== */

.mrf-comments-row {
    align-items: flex-start;
    margin-top: 15px;
}

.mrf-comments-row label {
    padding-top: 8px;
}

.mrf-comments-row textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    color: #333;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.mrf-comments-row textarea:focus {
    outline: none;
    border-color: #5dade2;
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */

.mrf-submit-row {
    text-align: center;
    margin-top: 25px;
}

.mrf-submit-btn {
    background: linear-gradient(to bottom, #5cb85c, #449d44);
    color: #fff;
    border: 1px solid #419641;
    border-radius: 4px;
    padding: 12px 35px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.mrf-submit-btn:hover {
    background: linear-gradient(to bottom, #449d44, #398439);
}

.mrf-submit-btn:active {
    transform: translateY(1px);
}

.mrf-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ========================================
   SUCCESS MESSAGE
   ======================================== */

.mrf-success-message {
    text-align: center;
    padding: 40px 20px;
}

.mrf-success-icon {
    width: 60px;
    height: 60px;
    background: #5cb85c;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 20px;
}

.mrf-success-message h3 {
    color: #5cb85c;
    font-size: 24px;
    margin-bottom: 10px;
}

.mrf-success-message p {
    color: #666;
    font-size: 14px;
}

/* ========================================
   ERROR MESSAGE
   ======================================== */

.mrf-error-message {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
}

.mrf-error-message p {
    color: #c0392b;
    margin: 0;
    font-size: 14px;
}

/* ========================================
   LOADING STATE
   ======================================== */

.mrf-btn-loading {
    display: inline-flex;
    align-items: center;
}

.mrf-btn-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    margin-right: 8px;
    animation: mrf-spin 0.8s linear infinite;
}

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

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */

@media (max-width: 580px) {
    .mrf-popup-container {
        bottom: 0;
        right: 0;
        left: 0;
        transform: translateY(100%);
    }
    
    .mrf-popup-container.mrf-active {
        transform: translateY(0);
    }
    
    .mrf-form-wrapper {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
    }
    
    .mrf-form-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mrf-form-row label {
        flex: none;
        text-align: left;
        padding-right: 0;
        margin-bottom: 5px;
    }
    
    .mrf-form-row input[type="text"],
    .mrf-form-row input[type="email"],
    .mrf-form-row input[type="tel"],
    .mrf-comments-row textarea {
        width: 100%;
    }
    
    .mrf-checkbox-group {
        padding-left: 0;
    }
    
    .mrf-checkbox-label {
        justify-content: flex-start;
        padding-right: 0;
        padding-left: 28px;
    }
    
    .mrf-checkbox-label input[type="checkbox"] {
        right: auto;
        left: 0;
    }
    
    .mrf-checkbox-text {
        margin-right: 0;
    }
    
    .mrf-popup-trigger {
        bottom: 15px;
        right: 15px;
    }
}
