/* ==========================================================================
   SIDEBAR CTA FORM STYLES
   Desktop sidebar + Mobile FAB + Mobile modal drawer
   ========================================================================== */

/* ==========================================================================
   DESKTOP SIDEBAR FORM
   ========================================================================== */
.sidebar-form {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 320px;
    background: white;
    box-shadow: -4px 0 20px rgba(15, 58, 125, 0.15);
    border-radius: 12px 0 0 12px;
    z-index: 999;
    transition: right 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.sidebar-form.minimized {
    right: -350px;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 100px;
    background: var(--brand-primary);
    border: none;
    border-radius: 8px 0 0 8px;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    writing-mode: vertical-rl;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--brand-primary-dark);
    left: -45px;
}

.sidebar-toggle .toggle-icon {
    transition: transform 0.3s ease;
}

.sidebar-form.minimized .sidebar-toggle .toggle-icon {
    transform: rotate(180deg);
}

.sidebar-form.minimized .sidebar-toggle .toggle-text::before {
    content: 'Get Quote';
}

.sidebar-form:not(.minimized) .sidebar-toggle .toggle-text::before {
    content: 'Close';
}

/* Sidebar Close Button (X) */
.sidebar-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: var(--bg-light);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
}

.sidebar-close-btn:hover {
    background: #E2E8F0;
    transform: rotate(90deg);
}

.sidebar-form.minimized .sidebar-close-btn {
    display: none;
}

/* Sidebar Form Content */
.sidebar-form-content {
    padding: 30px;
}

/* ==========================================================================
   MOBILE FLOATING ACTION BUTTON (FAB)
   ========================================================================== */
.mobile-fab {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(15, 58, 125, 0.4);
    cursor: pointer;
    z-index: 998;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.mobile-fab:active {
    transform: scale(0.95);
}

/* ==========================================================================
   MOBILE MODAL / DRAWER
   ========================================================================== */
.mobile-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.3s ease;
}

.mobile-modal-overlay.active {
    display: block;
}

.mobile-modal-drawer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 -4px 30px rgba(15, 58, 125, 0.2);
    -webkit-overflow-scrolling: touch;
}

.mobile-modal-drawer.active {
    display: block;
    animation: slideUpModal 0.3s ease;
}

/* Drag Handle */
.modal-drag-handle {
    display: flex;
    justify-content: center;
    padding: 12px 0;
    position: sticky;
    top: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    z-index: 1;
}

.drag-handle-bar {
    width: 40px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
}

/* Modal Close Button */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: var(--bg-light);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

/* Modal Form Content */
.modal-form-content {
    padding: 20px 20px 40px;
}

/* ==========================================================================
   FORM STYLES (Shared between desktop and mobile)
   ========================================================================== */
.form-header {
    margin-bottom: 25px;
    text-align: center;
}

.form-icon-container {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0F3A7D 0%, #1a4a8f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.form-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.5;
    margin: 0;
}

/* Page Source Badge */
.page-source-badge {
    background: #F0F5FF;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 12px;
    color: var(--brand-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Form Fields */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--error);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-base);
    outline: none;
    transition: border-color 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--brand-primary);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.char-count {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}

.field-error {
    font-size: 11px;
    color: var(--error);
    margin-top: 4px;
}

/* Submit Button */
.form-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: var(--radius-base);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-submit-btn:hover:not(:disabled) {
    background: var(--brand-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.form-submit-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

.form-submit-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Status Messages */
.form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: var(--radius-base);
    font-size: 13px;
    text-align: center;
    font-weight: 600;
}

.form-message.success {
    background: #F0FDF4;
    border: 1px solid var(--success);
    color: var(--success);
}

.form-message.error {
    background: #FEF2F2;
    border: 1px solid var(--error);
    color: var(--error);
}

/* Trust Indicators */
.trust-indicators {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-gray);
}

.trust-item svg {
    flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Desktop (>768px) - Show sidebar, hide mobile elements */
@media (min-width: 769px) {
    .sidebar-form {
        display: block;
    }
    
    .mobile-fab {
        display: none !important;
    }
    
    .mobile-modal-overlay,
    .mobile-modal-drawer {
        display: none !important;
    }
}

/* Mobile (<=768px) - Hide sidebar, show mobile elements */
@media (max-width: 768px) {
    .sidebar-form {
        display: none !important;
    }
    
    .mobile-fab {
        display: flex !important;
    }
    
    /* Prevent input zoom on iOS */
    .form-input,
    .form-textarea {
        font-size: 16px !important;
    }
    
    /* Active/Touch states */
    button:active {
        transform: scale(0.98);
    }
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUpModal {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */
.form-input:focus-visible,
.form-textarea:focus-visible,
.form-submit-btn:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}
.sidebar-form{
    margin-top: 18px !important;
}
