/* CT37 Edit Cars — Coche a la Carta — Formulario multi-paso */

:root {
    --ct37-accent:        #d4002d;
    --ct37-accent-hover:  #b5002a;
    --ct37-accent-glow:   rgba(212, 0, 45, 0.18);
    --ct37-card-bg:       #1e1e1e;
    --ct37-card-hover:    #262626;
    --ct37-border:        #2e2e2e;
    --ct37-border-sel:    #d4002d;
    --ct37-text:          #ffffff;
    --ct37-muted:         #888888;
    --ct37-radius:        12px;
    --ct37-ease:          0.22s ease;
}

/* ─── Wrapper ─────────────────────────────────────────────── */

.ct37-form-wrapper {
    max-width: 780px;
    margin: 40px auto;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    color: var(--ct37-text);
    -webkit-font-smoothing: antialiased;
}

/* ─── Progress bar ────────────────────────────────────────── */

.ct37-progress-bar {
    margin-bottom: 36px;
}

.ct37-progress-track {
    height: 3px;
    background: #2a2a2a;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 18px;
}

.ct37-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ct37-accent), #ff3c5a);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ct37-step-indicators {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.ct37-step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    transition: all 0.3s ease;
    cursor: default;
    flex-shrink: 0;
}

.ct37-step-dot.active {
    background: var(--ct37-accent);
    border-color: var(--ct37-accent);
    color: #fff;
    box-shadow: 0 0 0 5px var(--ct37-accent-glow);
}

.ct37-step-dot.done {
    background: transparent;
    border-color: var(--ct37-accent);
    color: var(--ct37-accent);
}

/* ─── Step title ──────────────────────────────────────────── */

.ct37-step-title {
    margin-bottom: 28px;
}

.ct37-step-subtitle {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--ct37-accent);
    margin-bottom: 8px;
    font-weight: 700;
}

.ct37-step-title h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--ct37-text);
    margin: 0;
    line-height: 1.25;
    transition: opacity 0.2s ease;
}

.ct37-step-hint {
    color: var(--ct37-muted);
    font-size: 14px;
    margin: -8px 0 22px;
}

/* ─── Steps ───────────────────────────────────────────────── */

.ct37-step {
    display: none;
}

.ct37-step.active {
    display: block;
    animation: ct37SlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ct37SlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Cards grid ──────────────────────────────────────────── */

.ct37-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 6px;
}

.ct37-cards-grid.ct37-cards-brands {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.ct37-cards-grid.ct37-cards-row {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

/* ─── Card ────────────────────────────────────────────────── */

.ct37-card {
    background: var(--ct37-card-bg);
    border: 2px solid var(--ct37-border);
    border-radius: var(--ct37-radius);
    padding: 22px 16px 18px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    position: relative;
    transition:
        border-color var(--ct37-ease),
        background   var(--ct37-ease),
        transform    0.15s ease,
        box-shadow   var(--ct37-ease);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.ct37-card:hover {
    border-color: #4a4a4a;
    background: var(--ct37-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.ct37-card.selected {
    border-color: var(--ct37-accent);
    background: var(--ct37-accent-glow);
    box-shadow: 0 0 0 1px var(--ct37-accent);
}

.ct37-card-icon {
    font-size: 30px;
    line-height: 1;
    display: block;
    margin-bottom: 4px;
    filter: grayscale(0.1);
}

.ct37-card-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--ct37-text);
    line-height: 1.2;
}

.ct37-card-desc {
    font-size: 11px;
    color: var(--ct37-muted);
    line-height: 1.4;
}

.ct37-card-check {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--ct37-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ct37-card.selected .ct37-card-check {
    display: flex;
}

/* Pill variant */
.ct37-card-pill {
    padding: 12px 14px;
    border-radius: 8px;
    flex-direction: row;
    justify-content: center;
    gap: 0;
}

.ct37-card-pill .ct37-card-label {
    font-size: 13px;
    font-weight: 600;
}

.ct37-card-pill .ct37-card-check {
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    font-size: 9px;
}

/* Brand cards */
.ct37-card-brand {
    padding: 14px 12px;
    border-radius: 10px;
}

.ct37-card-brand .ct37-card-label {
    font-size: 13px;
    font-weight: 600;
}

/* ─── Subsections ─────────────────────────────────────────── */

.ct37-subsection {
    margin-bottom: 30px;
}

.ct37-subsection:last-child {
    margin-bottom: 0;
}

.ct37-subsection-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--ct37-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 12px;
}

/* ─── Extras checkboxes ───────────────────────────────────── */

.ct37-extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 8px;
}

.ct37-extra-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    background: var(--ct37-card-bg);
    border: 2px solid var(--ct37-border);
    border-radius: 8px;
    cursor: pointer;
    transition:
        border-color var(--ct37-ease),
        background   var(--ct37-ease);
    -webkit-tap-highlight-color: transparent;
}

.ct37-extra-item:hover {
    border-color: #4a4a4a;
    background: var(--ct37-card-hover);
}

.ct37-extra-item input[type="checkbox"] {
    display: none;
}

.ct37-extra-check {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid #444;
    flex-shrink: 0;
    transition: all var(--ct37-ease);
    position: relative;
}

.ct37-extra-item input:checked ~ .ct37-extra-check {
    background: var(--ct37-accent);
    border-color: var(--ct37-accent);
}

.ct37-extra-item input:checked ~ .ct37-extra-check::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 18px;
    text-align: center;
}

.ct37-extra-label {
    font-size: 13px;
    color: #ccc;
    font-weight: 500;
    line-height: 1.3;
}

.ct37-extra-item:has(input:checked) {
    border-color: var(--ct37-accent);
    background: var(--ct37-accent-glow);
}

.ct37-extra-item:has(input:checked) .ct37-extra-label {
    color: var(--ct37-text);
}

/* ─── Text inputs ─────────────────────────────────────────── */

.ct37-field-group {
    margin-bottom: 16px;
}

.ct37-field-group:last-child {
    margin-bottom: 0;
}

.ct37-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--ct37-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ct37-input {
    width: 100%;
    background: var(--ct37-card-bg);
    border: 2px solid var(--ct37-border);
    border-radius: 8px;
    padding: 13px 16px;
    color: var(--ct37-text);
    font-size: 15px;
    font-family: inherit;
    transition: border-color var(--ct37-ease), box-shadow var(--ct37-ease);
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
}

.ct37-input:focus {
    border-color: var(--ct37-accent);
    box-shadow: 0 0 0 3px var(--ct37-accent-glow);
}

.ct37-input::placeholder {
    color: #444;
}

.ct37-textarea {
    resize: vertical;
    min-height: 85px;
    line-height: 1.5;
}

/* ─── Contact grid ────────────────────────────────────────── */

.ct37-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ct37-full-width {
    grid-column: 1 / -1;
}

/* ─── Privacy checkbox ────────────────────────────────────── */

.ct37-privacy {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 24px;
    cursor: pointer;
    font-size: 13px;
    color: #999;
    line-height: 1.55;
    -webkit-tap-highlight-color: transparent;
}

.ct37-privacy input[type="checkbox"] {
    display: none;
}

.ct37-privacy-check {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid #444;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all var(--ct37-ease);
    position: relative;
}

.ct37-privacy input:checked ~ .ct37-privacy-check {
    background: var(--ct37-accent);
    border-color: var(--ct37-accent);
}

.ct37-privacy input:checked ~ .ct37-privacy-check::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.ct37-privacy a {
    color: var(--ct37-accent);
    text-decoration: none;
}

.ct37-privacy a:hover {
    text-decoration: underline;
}

/* ─── Validation errors ───────────────────────────────────── */

.ct37-field-error {
    color: #ff4466;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
    display: none;
    align-items: center;
    gap: 5px;
}

.ct37-field-error::before {
    content: '!';
    display: inline-flex;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid #ff4466;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    flex-shrink: 0;
}

.ct37-field-error.visible {
    display: flex;
}

#ct37ContactErrors {
    margin-top: 12px;
}

/* ─── Navigation buttons ──────────────────────────────────── */

.ct37-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 36px;
    gap: 12px;
}

.ct37-btn-prev,
.ct37-btn-next,
.ct37-btn-submit {
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--ct37-ease);
    border: none;
    letter-spacing: 0.3px;
}

.ct37-btn-prev {
    background: transparent;
    border: 2px solid #333;
    color: #777;
}

.ct37-btn-prev:hover {
    border-color: #555;
    color: #ccc;
}

.ct37-btn-next,
.ct37-btn-submit {
    background: var(--ct37-accent);
    color: #fff;
    margin-left: auto;
    position: relative;
    overflow: hidden;
}

.ct37-btn-next:hover,
.ct37-btn-submit:hover:not(:disabled) {
    background: var(--ct37-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(212, 0, 45, 0.35);
}

.ct37-btn-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ─── Step label optional ─────────────────────────────────── */

.ct37-optional-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: var(--ct37-muted);
    background: #252525;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 2px 7px;
    letter-spacing: 0.5px;
    margin-left: 10px;
    vertical-align: middle;
    text-transform: uppercase;
}

/* ─── Success screen ──────────────────────────────────────── */

.ct37-success {
    text-align: center;
    padding: 64px 24px;
    animation: ct37SlideIn 0.4s ease;
}

.ct37-success-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--ct37-accent-glow);
    border: 2px solid var(--ct37-accent);
    color: var(--ct37-accent);
    font-size: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    font-weight: 900;
}

.ct37-success h3 {
    font-size: 26px;
    font-weight: 800;
    color: var(--ct37-text);
    margin: 0 0 12px;
}

.ct37-success p {
    color: #aaa;
    font-size: 15px;
    max-width: 420px;
    margin: 0 auto 10px;
    line-height: 1.6;
}

.ct37-success-contact a {
    color: var(--ct37-accent);
    text-decoration: none;
    font-weight: 600;
}

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 560px) {
    .ct37-form-wrapper {
        margin: 20px 0;
    }

    .ct37-step-title h2 {
        font-size: 19px;
    }

    .ct37-cards-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ct37-cards-grid.ct37-cards-row {
        grid-template-columns: 1fr 1fr;
    }

    .ct37-contact-grid {
        grid-template-columns: 1fr;
    }

    .ct37-btn-prev,
    .ct37-btn-next,
    .ct37-btn-submit {
        padding: 12px 20px;
        font-size: 13px;
    }

    .ct37-extras-grid {
        grid-template-columns: 1fr;
    }

    .ct37-step-dot {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
}
