/* ==========================================================================
   Persistent Slim Sidebar Quote Form Styles
   Aligned with Vision Digitizers Client Portal Design System (portal.css)
   ========================================================================== */

:root {
    --sq-pri: #285394;
    --sq-pri-hover: #1c3e72;
    --sq-pri-light: #eff3f8;
    --sq-sec: #152649;
    --sq-dark: #1b2432;
    --sq-text: #374151;
    --sq-muted: #6b7280;
    --sq-border: #dbe2ea;
    --sq-border-subtle: #eaedf2;
    --sq-card-bg: #ffffff;
    --sq-radius: 5px;
    --sq-radius-sm: 3px;
    --sq-shadow: 0 2px 6px -1px rgba(27, 36, 50, 0.06), 0 1px 2px rgba(27, 36, 50, 0.03);
    --sq-shadow-hover: 0 6px 16px -2px rgba(27, 36, 50, 0.09);
}

/* ==========================================================================
   Persistent Docked Tab (Right Screen Edge)
   ========================================================================== */
.sq-drawer-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 10px;
    background: var(--sq-pri);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-right: none;
    border-radius: 6px 0 0 6px;
    box-shadow: -3px 2px 14px rgba(27, 36, 50, 0.22);
    cursor: pointer;
    outline: none;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    font-family: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sq-drawer-tab:hover {
    background: var(--sq-pri-hover);
    transform: translateY(-50%) translateX(-3px);
    box-shadow: -5px 4px 18px rgba(27, 36, 50, 0.28);
}

.sq-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #ffffff;
}

.sq-tab-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
    user-select: none;
}

.sq-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid rgba(3, 105, 161, 0.2);
    line-height: 1;
    margin-top: 2px;
}

/* ==========================================================================
   Backdrop Overlay
   ========================================================================== */
.sq-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sq-drawer-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Slide-Out Drawer Panel
   ========================================================================== */
.sq-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 92vw;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sq-drawer-panel.is-open {
    transform: translateX(0);
}

/* Drawer Header */
.sq-drawer-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--sq-border);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
}

.sq-drawer-header-left {
    min-width: 0;
}

.sq-drawer-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sq-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.2;
}

.sq-drawer-title i {
    color: var(--sq-pri);
    font-size: 1rem;
}

.sq-drawer-sub {
    font-size: 0.75rem;
    color: var(--sq-muted);
    display: block;
    margin-top: 0.25rem;
    line-height: 1.3;
}

.sq-drawer-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--sq-radius-sm);
    border: 1px solid var(--sq-border);
    background: #f8fafc;
    color: var(--sq-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.sq-drawer-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* Drawer Body */
.sq-drawer-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.sq-drawer-body::-webkit-scrollbar {
    width: 5px;
}
.sq-drawer-body::-webkit-scrollbar-track {
    background: transparent;
}
.sq-drawer-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.sq-drawer-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Form Fields */
.sq-drawer-form .sq-field {
    margin-bottom: 0.7rem;
}

.sq-drawer-form .sq-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sq-text);
    margin-bottom: 0.3rem;
    line-height: 1.25;
}

/* Input Group with Icon (matching portal.css) */
.sq-input-group {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--sq-border);
    border-radius: var(--sq-radius-sm);
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
}

.sq-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.7rem;
    background: #f8fafc;
    border-right: 1px solid var(--sq-border);
    color: var(--sq-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.sq-input-group .sq-control {
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.sq-input-group:focus-within {
    border-color: var(--sq-pri);
    box-shadow: 0 0 0 3px rgba(40, 83, 148, 0.12);
}

/* Inputs & Selects */
.sq-control,
.sq-select {
    display: block;
    width: 100%;
    height: 35px;
    padding: 0.45rem 0.75rem;
    font-size: 0.825rem;
    font-family: inherit;
    color: #1e293b;
    background-color: #ffffff;
    border: 1px solid var(--sq-border);
    border-radius: var(--sq-radius-sm);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sq-control::placeholder {
    color: #9ca3af;
}

.sq-control:focus,
.sq-select:focus {
    border-color: var(--sq-pri);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(40, 83, 148, 0.12);
}

.sq-drawer-form textarea.sq-textarea {
    height: 62px;
    min-height: 50px;
    max-height: 120px;
    padding: 0.5rem 0.75rem;
    line-height: 1.4;
    resize: vertical;
}

.sq-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

/* File Upload */
.sq-file-upload {
    position: relative;
    border: 1px dashed var(--sq-border);
    border-radius: var(--sq-radius-sm);
    background: #fafbfc;
    padding: 0.45rem 0.65rem;
    transition: all 0.15s ease;
}

.sq-file-upload:hover {
    border-color: var(--sq-pri);
    background: var(--sq-pri-light);
}

.sq-file-upload input[type="file"] {
    display: block;
    width: 100%;
    font-size: 0.75rem;
    color: var(--sq-muted);
    cursor: pointer;
}

/* Submit Button - portal-btn style */
.sq-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 38px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--sq-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    background: var(--sq-pri);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(27, 36, 50, 0.04);
    transition: all 0.15s ease;
    margin-top: 0.75rem;
}

.sq-btn-submit:hover {
    background: var(--sq-pri-hover);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(40, 83, 148, 0.22);
}

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

/* Trust Footer */
.sq-footer-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--sq-border-subtle);
    font-size: 0.725rem;
    color: var(--sq-muted);
}
