/* ============================================
   TRADE-IN FORM STYLES
   ============================================ */

/* Page Header */
.page-header--trade-in {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
    color: #fff;
    padding: var(--space-16) 0;
    text-align: center;
}

.page-header--trade-in .page-header__title {
    color: #fff;
}

.page-header__subtitle {
    font-size: var(--text-lg);
    opacity: 0.9;
    margin-top: var(--space-2);
}

.page-header--trade-in .page-header__breadcrumb a,
.page-header--trade-in .page-header__breadcrumb span {
    color: rgba(255, 255, 255, 0.8);
}

.page-header--trade-in .page-header__breadcrumb a:hover {
    color: #fff;
}

/* Trade-In Intro */
.trade-in-intro {
    padding: var(--space-16) 0;
}

.trade-in-intro__content h2 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-4);
}

.trade-in-intro__content .lead {
    font-size: var(--text-lg);
    color: var(--brand-text-secondary);
    margin-bottom: var(--space-6);
}

/* Benefits List */
.trade-in-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trade-in-benefits li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    font-size: var(--text-base);
}

.trade-in-benefits svg {
    flex-shrink: 0;
    color: var(--brand-success);
}

/* Steps */
.trade-in-steps h3 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-6);
    text-align: center;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.step-card {
    background: var(--brand-surface);
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.step-card__number {
    width: 48px;
    height: 48px;
    background: var(--brand-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    font-weight: 700;
    margin: 0 auto var(--space-4);
}

.step-card h4 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
}

.step-card p {
    font-size: var(--text-sm);
    color: var(--brand-text-secondary);
    margin: 0;
}

/* Form Section */
.trade-in-form-section {
    background: var(--brand-bg-alt);
    padding: var(--space-16) 0;
}

.trade-in-form-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--brand-surface);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.trade-in-form-header {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
    color: #fff;
    padding: var(--space-8);
    text-align: center;
}

.trade-in-form-header h2 {
    color: #fff;
    margin-bottom: var(--space-2);
}

.trade-in-form-header p {
    opacity: 0.9;
    margin: 0;
}

/* ============================================
   WIZARD PROGRESS INDICATOR
   ============================================ */
.trade-in-form-wrapper {
    padding: 0;
}

.wizard-progress {
    padding: var(--space-6) var(--space-8);
    background: var(--brand-bg-alt);
    position: relative;
}

.wizard-progress__track {
    position: absolute;
    top: calc(var(--space-6) + 20px);
    left: var(--space-12);
    right: var(--space-12);
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    transform: translateY(-50%);
    z-index: 1;
}

.wizard-progress__fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--brand-accent);
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0%;
}

.wizard-progress__steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.wizard-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wizard-step-indicator:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.wizard-step-indicator__number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--brand-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-base);
    color: var(--brand-accent);
    transition: all 0.3s ease;
}

.wizard-step-indicator__label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--brand-text-secondary);
    transition: color 0.3s ease;
    white-space: nowrap;
}

/* Active step */
.wizard-step-indicator.active .wizard-step-indicator__number {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(var(--brand-accent-rgb), 0.4);
}

.wizard-step-indicator.active .wizard-step-indicator__label {
    color: var(--brand-accent);
    font-weight: 600;
}

/* Completed step */
.wizard-step-indicator.completed .wizard-step-indicator__number {
    background: #fff;
    border-color: var(--brand-accent);
    color: var(--brand-accent);
}

.wizard-step-indicator.completed .wizard-step-indicator__number::after {
    content: '✓';
    font-size: var(--text-sm);
}

.wizard-step-indicator.completed .wizard-step-indicator__label {
    color: var(--brand-accent);
}

/* ============================================
   WIZARD STEP CONTENT
   ============================================ */
#trade-in-form {
    padding: var(--space-8);
}

.wizard-steps-container {
    position: relative;
    overflow: hidden;
}

.wizard-step {
    display: none;
    animation: wizardFadeIn 0.4s ease forwards;
}

.wizard-step.active {
    display: block;
}

@keyframes wizardFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.wizard-step__header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--brand-accent);
}

.wizard-step__header h3 {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--brand-text-primary);
    margin: 0 0 var(--space-2) 0;
}

.wizard-step__header p {
    color: var(--brand-text-secondary);
    margin: 0;
    font-size: var(--text-sm);
}

/* ============================================
   WIZARD NAVIGATION BUTTONS
   ============================================ */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid #e5e7eb;
    gap: var(--space-4);
}

.wizard-nav__btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: var(--text-base);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.wizard-nav__btn--prev {
    background: var(--brand-surface);
    border-color: #e5e7eb;
    color: var(--brand-text-secondary);
}

.wizard-nav__btn--prev:hover:not(:disabled) {
    border-color: var(--brand-accent);
    color: var(--brand-accent);
}

.wizard-nav__btn--next,
.wizard-nav__btn--submit {
    background: var(--brand-accent);
    color: #fff;
    margin-left: auto;
}

.wizard-nav__btn--next:hover:not(:disabled),
.wizard-nav__btn--submit:hover:not(:disabled) {
    background: var(--brand-primary);
    transform: translateX(4px);
}

.wizard-nav__btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   BRAND SELECTOR
   ============================================ */
.brand-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-3);
}

.brand-selector-item {
    cursor: pointer;
}

.brand-selector-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.brand-selector-card {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-lg);
    background: #fff;
    transition: all 0.2s ease;
}

.brand-selector-item:hover .brand-selector-card {
    border-color: var(--brand-accent);
    background: #fafafa;
}

.brand-selector-input:checked ~ .brand-selector-card {
    border-color: var(--brand-accent);
    background: rgba(220, 53, 69, 0.05);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.brand-selector-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
    margin-bottom: var(--space-2);
    filter: brightness(0.2);
    transition: filter 0.2s ease;
}

.brand-selector-item:hover .brand-selector-logo {
    filter: brightness(0.3);
}

.brand-selector-input:checked ~ .brand-selector-card .brand-selector-logo {
    filter: brightness(0.1);
}

.brand-selector-name {
    font-size: var(--text-xs);
    text-align: center;
    color: #666;
}

.brand-selector-input:checked ~ .brand-selector-card .brand-selector-name {
    color: var(--brand-accent);
    font-weight: 600;
}

/* ============================================
   COLOR PICKER
   ============================================ */
.color-picker-preset {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-picker-option {
    cursor: pointer;
}

.color-picker-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.color-picker-swatch {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: all 0.2s ease;
}

.color-picker-option:hover .color-picker-swatch {
    transform: scale(1.1);
}

.color-picker-option input:checked ~ .color-picker-swatch {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

/* ============================================
   IMAGE UPLOAD
   ============================================ */
.image-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

.image-upload-slot {
    aspect-ratio: 4/3;
    border: 2px dashed #d1d5db;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
    position: relative;
    overflow: hidden;
}

.image-upload-slot:hover {
    border-color: var(--brand-accent);
    background: rgba(220, 53, 69, 0.02);
}

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

.image-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    color: #9ca3af;
    font-size: var(--text-sm);
}

.image-upload-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.image-upload-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   CONDITION RATING
   ============================================ */
.condition-rating-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.condition-rating-option {
    flex: 1;
    min-width: 100px;
    cursor: pointer;
}

.condition-rating-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.condition-rating-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    transition: all 0.2s ease;
    text-align: center;
}

.condition-rating-option:hover .condition-rating-card {
    border-color: #bbb;
    background: #f9f9f9;
}

.condition-rating-input:checked ~ .condition-rating-card {
    border-color: var(--rating-color);
    background: color-mix(in srgb, var(--rating-color) 8%, white);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rating-color) 20%, transparent);
}

.condition-rating-indicator {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.condition-rating-bar {
    width: 8px;
    height: 20px;
    background: #e0e0e0;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.condition-rating-bar.active {
    background: var(--rating-color);
}

.condition-rating-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.condition-rating-sublabel {
    font-size: 11px;
    color: #888;
}

.condition-rating-input:checked ~ .condition-rating-card .condition-rating-label {
    color: var(--rating-color);
}

/* ============================================
   RADIO LIST (Condition Questions)
   ============================================ */
.condition-field {
    margin-bottom: var(--space-5);
}

.radio-list-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.radio-list-option {
    display: block;
    cursor: pointer;
}

.radio-list-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-list-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    transition: all 0.15s ease;
}

.radio-list-option:hover .radio-list-card {
    border-color: #bbb;
    background: #fafafa;
}

.radio-list-input:checked ~ .radio-list-card {
    border-color: var(--brand-accent);
    background: #fff;
}

.radio-list-indicator {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background: #fff;
    position: relative;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.radio-list-input:checked ~ .radio-list-card .radio-list-indicator {
    border-color: var(--brand-accent);
}

.radio-list-input:checked ~ .radio-list-card .radio-list-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-accent);
}

.radio-list-label {
    font-size: 14px;
    color: #444;
}

.radio-list-input:checked ~ .radio-list-card .radio-list-label {
    color: #333;
}

/* ============================================
   SUCCESS MESSAGE
   ============================================ */
.wizard-success {
    text-align: center;
    padding: var(--space-12) var(--space-8);
}

.wizard-success__icon {
    color: var(--brand-success);
    margin-bottom: var(--space-6);
}

.wizard-success h3 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-4);
}

.wizard-success p {
    color: var(--brand-text-secondary);
    margin-bottom: var(--space-8);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   TWO-COLUMN LAYOUT
   ============================================ */
.trade-in-main {
    padding: var(--space-12) 0;
}

.trade-in-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-8, 2rem);
    align-items: start;
}

.trade-in-layout__info {
    position: sticky;
    top: 120px;
}

.trade-in-layout__info h2 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-4);
    color: var(--brand-text-primary);
}

.trade-in-layout__info .lead {
    font-size: var(--text-base);
    color: var(--brand-text-secondary);
    margin-bottom: var(--space-6);
    line-height: 1.7;
}

/* Benefits List (Two-Column Layout) */
.trade-in-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-8) 0;
}

.trade-in-benefits-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    font-size: var(--text-base);
    color: var(--brand-text-primary);
}

.trade-in-benefits-list svg {
    flex-shrink: 0;
    color: var(--brand-success);
    margin-top: 2px;
}

/* Steps List (Two-Column Layout) */
.trade-in-steps {
    background: var(--brand-bg-alt);
    padding: var(--space-6);
    border-radius: var(--radius-xl);
}

.trade-in-steps h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-5);
    text-align: left;
}

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

.step-item {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
}

.step-item__number {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--brand-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-base);
    font-weight: 700;
}

.step-item__content h4 {
    font-size: var(--text-base);
    font-weight: 600;
    margin: 0 0 var(--space-1) 0;
    color: var(--brand-text-primary);
}

.step-item__content p {
    font-size: var(--text-sm);
    color: var(--brand-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Form Container (Two-Column Layout) */
.trade-in-layout__form .trade-in-form-container {
    max-width: none;
    margin: 0;
}

/* ============================================
   FAQ SECTION
   ============================================ */
.trade-in-faq {
    padding: var(--space-16) 0;
}

.trade-in-faq .section-title {
    margin-bottom: var(--space-10);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    max-width: 1000px;
    margin: 0 auto;
}

.faq-item {
    background: var(--brand-surface);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.faq-item h4 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-3);
    color: var(--brand-text-primary);
}

.faq-item p {
    color: var(--brand-text-secondary);
    margin: 0;
    font-size: var(--text-sm);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
    .trade-in-layout {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .trade-in-layout__info {
        position: static;
    }

    .trade-in-intro__content {
        text-align: center;
        margin-bottom: var(--space-8);
    }

    .trade-in-benefits-list {
        display: inline-block;
        text-align: left;
    }

    .trade-in-benefits {
        display: inline-block;
        text-align: left;
    }
}

@media (max-width: 767px) {
    .steps-grid {
        grid-template-columns: 1fr;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .trade-in-form-header,
    #trade-in-form {
        padding: var(--space-6);
    }

    .wizard-progress {
        padding: var(--space-4);
    }

    .wizard-progress__track {
        left: var(--space-6);
        right: var(--space-6);
    }

    .wizard-step-indicator__number {
        width: 32px;
        height: 32px;
        font-size: var(--text-sm);
    }

    .wizard-step-indicator__label {
        font-size: 10px;
    }

    .wizard-nav {
        flex-wrap: wrap;
    }

    .wizard-nav__btn {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
    }

    .brand-selector {
        grid-template-columns: repeat(3, 1fr);
    }

    .image-upload-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .condition-rating-group {
        flex-direction: column;
    }

    .condition-rating-option {
        min-width: 100%;
    }

    .condition-rating-card {
        flex-direction: row;
        justify-content: flex-start;
        gap: 15px;
        padding: 12px 15px;
    }

    .condition-rating-indicator {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .wizard-step-indicator__label {
        display: none;
    }

    .wizard-progress__track {
        left: var(--space-4);
        right: var(--space-4);
    }

    .brand-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}
