/* Quote Page Styles */

/* ========================================
   QUOTE PAGE LAYOUT
   ======================================== */

.quote-page {
    min-height: 100vh;
    padding: var(--space-20) 0;
    margin-top: 80px; /* Account for fixed header */
}

.quote-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* ========================================
   HERO SECTION
   ======================================== */

.quote-hero {
    text-align: center;
    margin-bottom: var(--space-12);
}

.quote-title {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    line-height: var(--leading-tight);
}

.quote-title-icon {
    width: 32px;
    height: 32px;
    color: var(--red-500);
    flex-shrink: 0;
}

.quote-description {
    font-size: var(--text-lg);
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
    line-height: var(--leading-relaxed);
}

/* ========================================
   FORM CONTAINER
   ======================================== */

.quote-form-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: var(--space-8);
}

.quote-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

/* ========================================
   FORM SECTIONS
   ======================================== */

.form-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.form-section-title {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: white;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    line-height: var(--leading-tight);
}

.form-section-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-500);
    flex-shrink: 0;
}

/* ========================================
   FORM GRID
   ======================================== */

.form-grid {
    display: grid;
    gap: var(--space-4);
}

.form-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.form-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: rgba(255, 255, 255, 0.9);
    line-height: var(--leading-tight);
}

.form-label.required::after {
    content: ' *';
    color: var(--primary-500);
}

/* ========================================
   ENHANCED DROPDOWN STYLES
   ======================================== */

.custom-dropdown {
    position: relative;
    width: 100%;
}

.custom-dropdown-trigger {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: var(--text-base);
    color: white;
    background: transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
}

.custom-dropdown-trigger::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid white;
    transition: transform 0.3s ease;
}

.custom-dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.custom-dropdown-trigger:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.custom-dropdown-trigger.active::after {
    transform: translateY(-50%) rotate(180deg);
}

.custom-dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-height: 200px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 4px;
    display: block !important;
    pointer-events: none;
}

.custom-dropdown-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.custom-dropdown-option {
    padding: 12px 16px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: var(--text-base);
    pointer-events: auto;
}

.custom-dropdown-option:last-child {
    border-bottom: none;
}

.custom-dropdown-option:hover {
    background: var(--primary-500);
    color: white;
}

.custom-dropdown-option.selected {
    background: rgba(239, 68, 68, 0.2);
    color: var(--primary-500);
}

.custom-dropdown-option:first-child {
    border-radius: 8px 8px 0 0;
}

.custom-dropdown-option:last-child {
    border-radius: 0 0 8px 8px;
}

/* Scrollbar styling for dropdown */
.custom-dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.custom-dropdown-options::-webkit-scrollbar-thumb {
    background: var(--primary-500);
    border-radius: 3px;
}

.custom-dropdown-options::-webkit-scrollbar-thumb:hover {
    background: var(--primary-600);
}

/* Form Elements - Updated */
.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: var(--text-base);
    color: white;
    background: transparent;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* ========================================
   CHECKBOXES
   ======================================== */

.checkbox-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.checkbox-label {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: white;
    line-height: var(--leading-tight);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.checkbox-input {
    width: 16px;
    height: 16px;
    color: var(--red-500);
    border-color: var(--gray-300);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.checkbox-text {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.9);
    line-height: var(--leading-tight);
    cursor: pointer;
    user-select: none;
}

/* ========================================
   SUBMIT SECTION
   ======================================== */

.form-submit {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding-top: var(--space-4);
}

.submit-button {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 48px;
}

.submit-button:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.submit-button-icon {
    width: 20px;
    height: 20px;
}

.submit-spinner {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.submit-note {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.8);
    line-height: var(--leading-relaxed);
}

/* ========================================
   VALIDATION STATES
   ======================================== */

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--red-500);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.form-error-message {
    font-size: var(--text-sm);
    color: var(--red-500);
    margin-top: var(--space-1);
}

.form-input.success,
.form-select.success,
.form-textarea.success {
    border-color: var(--green-500);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* ========================================
   PROGRESS INDICATOR
   ======================================== */

.form-progress {
    margin-bottom: var(--space-8);
}

.progress-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--red-500);
    transition: width 0.3s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-2);
}

.progress-step {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-align: center;
}

.progress-step.active {
    color: var(--red-500);
    font-weight: var(--font-medium);
}

.progress-step.completed {
    color: var(--green-500);
}

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

@media (max-width: 768px) {
    .quote-page {
        padding: var(--space-16) 0;
        margin-top: 60px; /* Smaller header on mobile */
    }
    
    .quote-title {
        font-size: var(--text-3xl);
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .quote-description {
        font-size: var(--text-base);
    }
    
    .quote-form-container {
        padding: var(--space-6);
    }
    
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .form-submit {
        flex-direction: column;
        align-items: stretch;
    }
    
    .submit-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .quote-page {
        padding: var(--space-12) 0;
    }
    
    .quote-title {
        font-size: var(--text-2xl);
    }
    
    .quote-form-container {
        padding: var(--space-4);
    }
    
    .form-section-title {
        font-size: var(--text-lg);
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 10px 14px;
        font-size: var(--text-sm);
    }
    
    .submit-button {
        padding: 10px 20px;
        font-size: var(--text-sm);
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.checkbox-input:focus,
.submit-button:focus {
    outline: 2px solid var(--red-500);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .quote-form-container {
        border: 2px solid black;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        border: 2px solid black;
        background: white;
        color: black;
    }
    
    .submit-button {
        background: black;
        color: white;
        border: 2px solid black;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .form-input,
    .form-select,
    .form-textarea,
    .submit-button,
    .submit-spinner {
        transition: none;
        animation: none;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .quote-page {
        margin-top: 0;
        padding: var(--space-4) 0;
        background: white;
    }
    
    .quote-form-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .submit-button {
        display: none;
    }
    
    .form-section {
        page-break-inside: avoid;
    }
}
