/* ============================================
   Hampstead Motors - Trade-In Page Styles
   ============================================ */

/* Import Bold Sans-Serif Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* CSS Custom Properties (matching homepage) */
:root {
    --hm-primary: #db2d2e;
    --hm-primary-dark: #b02426;
    --hm-primary-light: #e64d4e;
    --hm-black: #000000;
    --hm-gray-dark: #1a1a1a;
    --hm-gray: #4a4a4a;
    --hm-gray-light: #e5e5e5;
    --hm-gray-lighter: #f5f5f5;
    --hm-white: #ffffff;
    --hm-transition: all 0.3s ease;
    --hm-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    --hm-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.18);
    --hm-border-radius: 6px;
    --hm-max-width: 1200px;
}

/* Reset & Base Styles - scoped to trade content only, not nav/footer */
.hm-trade-hero *,
.hm-trade-form-section * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hm-trade-page,
.hm-trade-page * {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hm-trade-page {
    font-weight: 500;
    color: var(--hm-gray-dark);
    line-height: 1.6;
    background-color: var(--hm-white);
}

.hm-trade-container {
    max-width: var(--hm-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Trade-In Hero Section
   ============================================ */
.hm-trade-hero {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('https://images.unsplash.com/photo-1503376780353-7e6692767b70?w=1600&h=900&fit=crop');
    background-size: cover;
    background-position: center;
}

.hm-trade-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(26, 26, 26, 0.75) 50%, rgba(219, 45, 46, 0.4) 100%);
}

.hm-trade-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--hm-white);
    padding: 80px 20px;
    max-width: 800px;
}

.hm-trade-hero-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.1;
    letter-spacing: -2px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hm-trade-hero-subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 24px;
    opacity: 0.95;
    line-height: 1.6;
}

.hm-trade-hero-info {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hm-trade-hero-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.hm-trade-hero-info-item svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Form Section
   ============================================ */
.hm-trade-form-section {
    padding: 60px 0 80px;
    background-color: var(--hm-gray-lighter);
}

.hm-trade-form-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--hm-black);
    margin-bottom: 12px;
    letter-spacing: -1px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
}

.hm-trade-form-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--hm-primary);
    border-radius: 2px;
}

.hm-trade-form-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 8px;
}

.hm-trade-form-subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: var(--hm-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* Progress Indicator */
.hm-trade-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.hm-trade-progress-step {
    width: 40px;
    height: 6px;
    background-color: var(--hm-gray-light);
    border-radius: 3px;
    transition: var(--hm-transition);
}

.hm-trade-progress-step.completed {
    background-color: rgba(219, 45, 46, 0.4);
}

.hm-trade-progress-step.active {
    background-color: var(--hm-primary);
    transform: scaleY(1.3);
}

/* Form Container */
.hm-trade-form {
    max-width: 900px;
    margin: 0 auto;
}

/* Accordion Sections */
.hm-trade-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hm-trade-accordion-item {
    background-color: var(--hm-white);
    border-radius: var(--hm-border-radius);
    box-shadow: var(--hm-shadow);
    overflow: hidden;
    border: 2px solid transparent;
    transition: var(--hm-transition);
}

.hm-trade-accordion-item:hover {
    border-color: var(--hm-gray-light);
}

.hm-trade-accordion-item.active {
    border-color: var(--hm-primary);
    box-shadow: 0 4px 16px rgba(219, 45, 46, 0.15);
}

.hm-trade-accordion-item.active .hm-trade-accordion-header {
    background-color: rgba(219, 45, 46, 0.03);
}

.hm-trade-accordion-item.active .hm-trade-accordion-title {
    color: var(--hm-primary);
}

.hm-trade-accordion-item.completed .hm-trade-accordion-header {
    background-color: rgba(219, 45, 46, 0.05);
}

.hm-trade-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    cursor: pointer;
    transition: var(--hm-transition);
    user-select: none;
}

.hm-trade-accordion-header:hover {
    background-color: var(--hm-gray-lighter);
}

.hm-trade-accordion-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hm-trade-accordion-number {
    width: 32px;
    height: 32px;
    background-color: var(--hm-gray-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--hm-gray);
    transition: var(--hm-transition);
}

.hm-trade-accordion-item.active .hm-trade-accordion-number,
.hm-trade-accordion-item.completed .hm-trade-accordion-number {
    background-color: var(--hm-primary);
    color: var(--hm-white);
}

.hm-trade-accordion-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--hm-black);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hm-trade-accordion-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    color: var(--hm-gray);
}

.hm-trade-accordion-item.active .hm-trade-accordion-icon {
    transform: rotate(180deg);
    color: var(--hm-primary);
}

.hm-trade-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.hm-trade-accordion-item.active .hm-trade-accordion-content {
    max-height: 3000px;
}

.hm-trade-accordion-body {
    padding: 0 24px 24px;
}

/* Form Elements */
.hm-trade-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.hm-trade-form-row.three-col {
    grid-template-columns: repeat(3, 1fr);
}

.hm-trade-form-row.single {
    grid-template-columns: 1fr;
}

.hm-trade-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hm-trade-form-group.full-width {
    grid-column: 1 / -1;
}

.hm-trade-form-label {
    font-weight: 700;
    color: var(--hm-black);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hm-trade-form-label .required {
    color: var(--hm-primary);
}

.hm-trade-form-input,
.hm-trade-form-select,
.hm-trade-form-textarea {
    padding: 12px 14px;
    border: 2px solid var(--hm-gray-light);
    border-radius: var(--hm-border-radius);
    font-family: 'Inter', sans-serif !important;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--hm-transition);
    background-color: var(--hm-white);
}

.hm-trade-form-input:focus,
.hm-trade-form-select:focus,
.hm-trade-form-textarea:focus {
    outline: none;
    border-color: var(--hm-primary);
}

.hm-trade-form-input::placeholder {
    color: var(--hm-gray);
    opacity: 0.7;
}

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

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

/* Checkbox Groups */
.hm-trade-checkbox-section {
    margin-bottom: 20px;
}

.hm-trade-checkbox-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--hm-black);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hm-trade-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.hm-trade-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.hm-trade-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--hm-primary);
    cursor: pointer;
}

.hm-trade-checkbox-item label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hm-gray-dark);
    cursor: pointer;
}

/* Radio Groups */
.hm-trade-radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.hm-trade-radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.hm-trade-radio-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--hm-primary);
    cursor: pointer;
}

.hm-trade-radio-item label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--hm-gray-dark);
    cursor: pointer;
}

/* File Upload */
.hm-trade-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.hm-trade-photo-upload {
    border: 2px dashed var(--hm-gray-light);
    border-radius: var(--hm-border-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--hm-transition);
    background-color: var(--hm-gray-lighter);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hm-trade-photo-upload:hover {
    border-color: var(--hm-primary);
    background-color: rgba(219, 45, 46, 0.05);
}

.hm-trade-photo-upload.has-file {
    border-color: var(--hm-primary);
    background-color: rgba(219, 45, 46, 0.1);
}

.hm-trade-photo-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.hm-trade-photo-upload-icon {
    width: 32px;
    height: 32px;
    color: var(--hm-gray);
    margin-bottom: 8px;
}

.hm-trade-photo-upload-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--hm-black);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.hm-trade-photo-upload-text {
    font-size: 0.75rem;
    color: var(--hm-gray);
}

.hm-trade-photo-preview {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.hm-trade-photo-filename {
    font-size: 0.7rem;
    color: var(--hm-primary);
    font-weight: 600;
    word-break: break-all;
}

/* Range Slider */
.hm-trade-range-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hm-trade-range-input {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: var(--hm-gray-light);
    border-radius: 3px;
    outline: none;
}

.hm-trade-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--hm-primary);
    border-radius: 50%;
    cursor: pointer;
}

.hm-trade-range-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--hm-primary);
    text-align: center;
}

/* Submit Button */
.hm-trade-submit-wrapper {
    margin-top: 24px;
    text-align: center;
}

.hm-trade-submit-btn {
    display: inline-block;
    padding: 16px 48px;
    font-family: 'Inter', sans-serif !important;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    background-color: var(--hm-primary);
    color: var(--hm-white);
    border: 2px solid var(--hm-primary);
    border-radius: var(--hm-border-radius);
    cursor: pointer;
    transition: var(--hm-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hm-trade-submit-btn:hover {
    background-color: var(--hm-primary-dark);
    border-color: var(--hm-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--hm-shadow-lg);
}

.hm-trade-submit-btn:disabled {
    background-color: var(--hm-gray);
    border-color: var(--hm-gray);
    cursor: not-allowed;
    transform: none;
}

/* Form Messages */
.hm-trade-message {
    padding: 16px 20px;
    border-radius: var(--hm-border-radius);
    display: none;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.hm-trade-message.show {
    display: flex;
}

.hm-trade-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.hm-trade-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.hm-trade-message svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Loading Spinner */
.hm-trade-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
}

.hm-trade-loading.show {
    display: flex;
}

.hm-trade-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--hm-gray-light);
    border-top-color: var(--hm-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 991px) {
    .hm-trade-photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .hm-trade-hero {
        min-height: 40vh;
    }

    .hm-trade-hero-content {
        padding: 60px 20px;
    }

    .hm-trade-hero-title {
        font-size: 2rem;
        letter-spacing: -1px;
    }

    .hm-trade-hero-subtitle {
        font-size: 1rem;
    }

    .hm-trade-hero-info {
        gap: 16px;
    }

    .hm-trade-hero-info-item {
        font-size: 0.85rem;
    }

    .hm-trade-form-section {
        padding: 40px 0 60px;
    }

    .hm-trade-form-title {
        font-size: 1.5rem;
    }

    .hm-trade-form-row,
    .hm-trade-form-row.three-col {
        grid-template-columns: 1fr;
    }

    .hm-trade-accordion-header {
        padding: 16px 20px;
    }

    .hm-trade-accordion-body {
        padding: 0 20px 20px;
    }

    .hm-trade-accordion-title {
        font-size: 1rem;
    }

    .hm-trade-photo-grid {
        grid-template-columns: 1fr;
    }

    .hm-trade-checkbox-grid {
        grid-template-columns: 1fr;
    }

    .hm-trade-radio-group {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .hm-trade-hero-info {
        flex-direction: column;
        gap: 12px;
    }

    .hm-trade-submit-btn {
        width: 100%;
    }
}
