/* ============================================
   Quote Modal – Apple-neutral blue palette
   ============================================ */

.quote-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    padding: 16px;
    align-items: center;
    justify-content: center;
}

.quote-modal * {
    box-sizing: border-box;
}

.quote-modal.open {
    display: flex;
}

/* Modal content card */
.quote-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: quoteModalIn 0.2s ease;
}

@keyframes quoteModalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Header */
.quote-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.quote-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.quote-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    color: #6b7280;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quote-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Description banner */
.quote-modal-description {
    padding: 12px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}

/* Body */
.quote-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Form groups */
.quote-form-group {
    margin-bottom: 16px;
}

.quote-form-group:last-child {
    margin-bottom: 0;
}

.quote-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

/* Inputs, selects, textareas */
.quote-input,
.quote-select,
.quote-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2937;
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    font-family: inherit;
}

.quote-input:focus,
.quote-select:focus,
.quote-textarea:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.quote-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

.quote-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Validation error */
.quote-error {
    font-size: 12px;
    color: #FF3B30;
    margin-top: 4px;
    display: block;
}

/* File upload */
.quote-file-upload {
    position: relative;
}

.quote-file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.quote-file-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    font-size: 14px;
    transition: border-color 0.15s, background 0.15s;
}

.quote-file-label:hover {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.06);
}

/* Footer */
.quote-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 16px 16px;
}

/* Buttons */
.quote-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.quote-btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.quote-btn-secondary:hover {
    background: #f3f4f6;
}

.quote-btn-primary {
    background: linear-gradient(135deg, #007AFF, #0063D1);
    color: white;
}

.quote-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.quote-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success state */
.quote-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.quote-success.show {
    display: flex;
}

.quote-success svg {
    color: #34C759;
    margin-bottom: 16px;
}

.quote-success h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px;
}

.quote-success p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    max-width: 300px;
    line-height: 1.5;
}

/* Loading spinner */
.quote-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: quoteSpin 0.6s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes quoteSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Checkbox group */
.quote-checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.quote-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s;
    margin: 0;
}

.quote-checkbox:hover {
    border-color: #007AFF;
}

.quote-checkbox:checked {
    background: #007AFF;
    border-color: #007AFF;
}

.quote-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 45%;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

.quote-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

/* ============================================
   Responsive – full-screen on mobile
   ============================================ */

@media (max-width: 600px) {
    .quote-modal {
        padding: 0;
    }

    .quote-modal-content {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }
}
