/* Base Variables */
:root {
    --ragd-primary: #0A2647;
    --ragd-primary-dark: #071C35;
    --ragd-accent: #ff4757;
    --ragd-accent-hover: #e04040;
    --ragd-success: #27ae60;
    --ragd-white: #ffffff;
    --ragd-bg-panel: #ffffff;
    --ragd-text-main: #2c3e50;
    --ragd-text-sub: #7f8c8d;
    --ragd-shadow: -5px 0 35px rgba(0, 0, 0, 0.2);
    --ragd-font: 'Inter', system-ui, -apple-system, sans-serif;
    --ragd-z-index: 999999;
}
/* --- Container --- */
.ragd-widget-container {
    font-family: var(--ragd-font);
    box-sizing: border-box;
    line-height: 1.5;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--ragd-z-index);
    pointer-events: none;
}
.ragd-widget-container * {
    box-sizing: border-box;
    pointer-events: auto;
}
/* ============================================
   MOBILE: Bottom Bar with Right-Side Toggle
   ============================================ */
/* Mobile Bottom Bar */
.ragd-side-tab {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    background: linear-gradient(135deg, var(--ragd-accent) 0%, #c93a3a 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: var(--ragd-z-index);
    pointer-events: all !important;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: auto;
    border: none;
}
/* Main content - horizontal layout */
.ragd-tab-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex: 1;
}
/* Person icon */
.ragd-tab-icon {
    font-size: 30px !important;
    width: 30px !important;
    height: 30px !important;
    color: white;
    flex-shrink: 0;
}
/* Text */
.ragd-tab-text {
    font-weight: 700;
    font-size: clamp(14px, 4vw, 17px);
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-transform: uppercase;
}
/* Green status dot - BIGGER and inline */
.ragd-status-dot {
    width: 16px;
    height: 16px;
    background: #2ecc71;
    border: 3px solid white;
    border-radius: 50%;
    animation: dotPulse 1.2s ease-in-out infinite;
    flex-shrink: 0;
    margin-left: 6px;
}
/* ONLINE label */
.ragd-status-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #2ecc71;
    text-transform: uppercase;
}
@keyframes dotPulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.8);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }
}
/* Toggle button - RIGHT SIDE, single big arrow */
/* Toggle button - REMOVED per user request */
.ragd-tab-toggle {
    display: none !important;
}
.ragd-toggle-arrow {
    font-size: 22px;
    color: white;
    transition: transform 0.3s;
    line-height: 1;
}
/* Minimized state */
.ragd-side-tab.minimized {
    transform: translateY(calc(100% - 60px));
}
.ragd-side-tab.minimized .ragd-toggle-arrow {
    transform: rotate(180deg);
}
.ragd-side-tab:hover {
    background: linear-gradient(135deg, var(--ragd-accent-hover) 0%, #b33232 100%);
}
/* Hide tab when panel is open */
.ragd-widget-container.active .ragd-side-tab {
    transform: translateY(100%);
}
/* --- Sliding Panel --- */
.ragd-side-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    height: 85vh;
    max-height: 85vh;
    background: var(--ragd-bg-panel);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    z-index: var(--ragd-z-index);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    border-radius: 20px 20px 0 0;
}
.ragd-widget-container.active .ragd-side-panel {
    transform: translateY(0);
}
/* Header */
.ragd-panel-header {
    background: var(--ragd-primary);
    color: white;
    padding: clamp(15px, 4vw, 20px) clamp(15px, 4vw, 25px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--ragd-accent);
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
}
.ragd-panel-header h3 {
    margin: 0;
    font-size: clamp(1rem, 4vw, 1.2rem);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}
.ragd-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: clamp(32px, 8vw, 40px);
    height: clamp(32px, 8vw, 40px);
    border-radius: 50%;
    cursor: pointer;
    font-size: clamp(20px, 5vw, 26px);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.ragd-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}
/* Body */
.ragd-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: clamp(15px, 4vw, 25px);
    background: #f8fafc;
    position: relative;
}
.ragd-intro {
    font-size: clamp(14px, 3.5vw, 16px);
    line-height: 1.6;
    color: var(--ragd-text-main);
    margin-bottom: clamp(15px, 4vw, 25px);
    background: #eef5f8;
    padding: clamp(10px, 3vw, 15px);
    border-radius: 8px;
    border-left: 4px solid var(--ragd-primary);
}
/* Forms - Responsive */
.ragd-form-group {
    margin-bottom: clamp(12px, 3vw, 18px);
}
.ragd-form-group label {
    display: block;
    margin-bottom: clamp(6px, 2vw, 10px);
    font-size: clamp(14px, 3.5vw, 16px);
    font-weight: 700;
    color: var(--ragd-primary);
}
.ragd-input,
.ragd-textarea {
    width: 100%;
    padding: clamp(12px, 3vw, 16px);
    border: 1px solid #ced6e0;
    border-radius: 6px;
    font-size: clamp(15px, 4vw, 17px);
    transition: border 0.3s;
    background: white;
}
.ragd-input:focus,
.ragd-textarea:focus {
    border-color: var(--ragd-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 113, 150, 0.1);
}
.ragd-textarea {
    min-height: clamp(80px, 20vw, 100px);
    resize: vertical;
}
/* Buttons - Responsive */
.ragd-btn-submit {
    width: 100%;
    background: var(--ragd-primary);
    color: white;
    border: none;
    padding: clamp(14px, 3.5vw, 18px);
    border-radius: 6px;
    font-size: clamp(15px, 4vw, 18px);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.ragd-btn-submit:hover {
    background: var(--ragd-primary-dark);
}
/* Results */
.ragd-diagnosis-card {
    background: white;
    border-radius: 8px;
    padding: clamp(15px, 4vw, 20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: clamp(15px, 4vw, 25px);
    border: 1px solid #e0e0e0;
}
.ragd-result-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}
.ragd-result-item:last-child {
    border: none;
    margin: 0;
    padding: 0;
}
.ragd-result-label {
    font-size: clamp(10px, 2.5vw, 11px);
    text-transform: uppercase;
    color: #999;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.ragd-result-value {
    font-size: clamp(14px, 3.5vw, 15px);
    color: var(--ragd-text-main);
    font-weight: 500;
    margin-top: 4px;
}
.ragd-cost-highlight {
    color: var(--ragd-accent);
    font-size: clamp(18px, 5vw, 22px);
    font-weight: 800;
}
/* Call To Action Section */
.ragd-cta-section {
    text-align: center;
}
.ragd-cta-title {
    font-weight: 700;
    font-size: clamp(14px, 3.5vw, 16px);
    color: var(--ragd-text-main);
    margin-bottom: 15px;
}
.ragd-btn-call {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--ragd-accent);
    color: white;
    text-decoration: none;
    padding: clamp(12px, 3vw, 14px);
    border-radius: 6px;
    font-weight: 700;
    font-size: clamp(16px, 4vw, 18px);
    gap: 10px;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}
.ragd-btn-call:hover {
    background: var(--ragd-accent-hover);
    transform: translateY(-2px);
    color: white;
}
.ragd-or-divider {
    margin: clamp(12px, 3vw, 20px) 0;
    position: relative;
    text-align: center;
}
.ragd-or-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #e0e0e0;
}
.ragd-or-divider span {
    background: #f8fafc;
    padding: 0 10px;
    color: #999;
    font-size: clamp(10px, 2.5vw, 12px);
    position: relative;
}
.ragd-btn-primary-outline {
    width: 100%;
    background: white;
    border: 2px solid var(--ragd-primary);
    color: var(--ragd-primary);
    padding: clamp(10px, 2.5vw, 12px);
    border-radius: 6px;
    font-weight: 600;
    font-size: clamp(14px, 3.5vw, 16px);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.ragd-btn-primary-outline:hover {
    background: #eaf6fa;
}
/* Lead Form */
.ragd-lead-container {
    animation: fadeSlideIn 0.3s ease-out;
}
.ragd-lead-container h4 {
    margin-top: 0;
    color: var(--ragd-primary);
    margin-bottom: 5px;
    font-size: clamp(16px, 4vw, 18px);
}
.ragd-subtext {
    font-size: clamp(12px, 3vw, 13px);
    color: #7f8c8d;
    margin-bottom: 20px;
}
.ragd-btn-text {
    background: none;
    border: none;
    color: #95a5a6;
    text-decoration: underline;
    width: 100%;
    margin-top: 15px;
    font-size: clamp(12px, 3vw, 13px);
    cursor: pointer;
}
/* Success State */
.ragd-final-success {
    text-align: center;
    padding: clamp(25px, 6vw, 40px) clamp(15px, 4vw, 20px);
    animation: fadeSlideIn 0.3s ease-out;
}
.ragd-success-icon {
    font-size: clamp(48px, 12vw, 64px);
    color: var(--ragd-success);
    margin-bottom: 20px;
    width: clamp(48px, 12vw, 64px);
    height: clamp(48px, 12vw, 64px);
}
.ragd-final-success h4 {
    font-size: clamp(16px, 4.5vw, 20px);
    margin-bottom: 10px;
}
.ragd-final-success p {
    font-size: clamp(13px, 3.5vw, 15px);
}
.ragd-btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
    border: none;
    padding: clamp(8px, 2vw, 10px) clamp(16px, 4vw, 20px);
    border-radius: 4px;
    margin-top: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: clamp(13px, 3.5vw, 15px);
}
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Loader */
.ragd-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}
.ragd-spinner {
    width: clamp(32px, 8vw, 40px);
    height: clamp(32px, 8vw, 40px);
    border: 4px solid #ecf0f1;
    border-top: 4px solid var(--ragd-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}
.ragd-loader-text {
    font-size: clamp(13px, 3.5vw, 15px);
    color: var(--ragd-text-main);
}
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}
/* Backdrop */
.ragd-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    z-index: calc(var(--ragd-z-index) - 1);
}
.ragd-widget-container.active .ragd-backdrop {
    opacity: 1;
    visibility: visible;
}
/* ============================================
   DESKTOP: Side Tab on Left, Center Modal
   ============================================ */
@media (min-width: 769px) {
    /* Hide toggle completely on desktop */
    .ragd-tab-toggle {
        display: none !important;
    }
    /* Side Tab - Vertical on Left */
    .ragd-side-tab {
        bottom: auto;
        left: 0;
        right: auto;
        top: 15%;
        padding: 25px 18px;
        min-height: auto;
        border-radius: 0 16px 16px 0;
        background: linear-gradient(180deg, var(--ragd-accent) 0%, #c93a3a 100%);
        flex-direction: column;
        justify-content: center;
        gap: 0;
        box-shadow: 6px 0 30px rgba(0, 0, 0, 0.3);
    }
    /* Tab content - vertical on desktop */
    .ragd-tab-content {
        flex-direction: row;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        gap: 12px;
        flex: 0;
    }
    .ragd-tab-icon {
        font-size: 44px !important;
        width: 44px !important;
        height: 44px !important;
    }
    .ragd-tab-text {
        font-size: 18px;
        letter-spacing: 2px;
        writing-mode: vertical-rl;
        text-orientation: mixed;
    }
    /* Status dot - horizontal orientation, proper size */
    .ragd-status-dot {
        width: 18px;
        height: 18px;
        border-width: 3px;
        margin-left: 0;
        margin-top: 8px;
        writing-mode: horizontal-tb;
    }
    /* ONLINE label - horizontal under dot */
    .ragd-status-label {
        font-size: 10px;
        letter-spacing: 1px;
        writing-mode: horizontal-tb;
        margin-top: 4px;
    }
    .ragd-side-tab.minimized {
        transform: none;
    }
    .ragd-side-tab:hover {
        padding-left: 22px;
        transform: translateX(8px);
        background: linear-gradient(180deg, var(--ragd-accent-hover) 0%, #b33232 100%);
    }
    .ragd-widget-container.active .ragd-side-tab {
        transform: translateX(-200px);
    }
    /* Panel as Center Modal */
    .ragd-side-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        width: 600px;
        /* Wider for better readability */
        max-width: 92vw;
        height: auto;
        max-height: 85vh;
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
        pointer-events: none;
        border-radius: 12px;
        box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .ragd-widget-container.active .ragd-side-panel {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        pointer-events: all;
    }
    .ragd-panel-header {
        border-radius: 12px 12px 0 0;
    }
    .ragd-panel-header h3 {
        font-size: 1.3rem;
        /* ~21px */
    }
    /* UX-optimized desktop fonts */
    .ragd-intro {
        font-size: 18px;
        line-height: 1.7;
        padding: 18px;
    }
    .ragd-form-group label {
        font-size: 17px;
        margin-bottom: 12px;
    }
    .ragd-input,
    .ragd-textarea {
        font-size: 18px;
        padding: 18px;
    }
    .ragd-textarea {
        min-height: 120px;
    }
    .ragd-btn-submit {
        font-size: 20px;
        padding: 20px;
    }
    .ragd-btn-call {
        font-size: 20px;
        padding: 16px;
    }
    .ragd-btn-primary-outline {
        font-size: 17px;
        padding: 14px;
    }
    .ragd-result-value {
        font-size: 17px;
    }
    .ragd-cost-highlight {
        font-size: 26px;
    }
    .ragd-cta-title {
        font-size: 18px;
    }
    .ragd-lead-container h4 {
        font-size: 20px;
    }
    .ragd-subtext {
        font-size: 15px;
    }
}
/* --- Utilities --- */
.ragd-visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}