/* ============================================================
   Test Drive Page — matched to Figma SVG (1440×1154)
   ============================================================ */

.test-drive-page {
    --td-card: #F6F6F6;
    --td-input-bg: #F6F6F6;
    --td-text: #1E1E1E;
    --td-border: rgba(30, 30, 30, 0.3);
    --td-placeholder: rgba(30, 30, 30, 0.5);
    --td-phone-bg: #F6F6F6;
    font-family: 'Montserrat', sans-serif;
    margin-top: 80px;
}

/* New layout: content starts under transparent header (no white gap) */
body.layout-new .test-drive-page {
    margin-top: 0;
}

/* ── Hero (full background image, no crop) ────────────────── */
.td-hero {
    position: relative;
    width: 100%;
    line-height: 0;
}

.td-hero__img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: top;
}

.td-hero__inner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    justify-content: center;
    padding: clamp(12px, 2.8vw, 40px) 24px 0;
    line-height: normal;
}

/* ── Form Card ────────────────────────────────────────────── */
.td-form-card {
    background: var(--td-card);
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 904px;
    padding: clamp(28px, 3.1vw, 45px) clamp(20px, 2.2vw, 32px) clamp(24px, 2.8vw, 36px);
}

.td-form-title {
    font-size: clamp(22px, 1.94vw, 28px);
    font-weight: 700;
    text-align: center;
    color: var(--td-text);
    margin: 0 0 10px;
    letter-spacing: 0;
    line-height: 1.2;
}

.td-form-subtitle {
    font-size: clamp(14px, 1.25vw, 18px);
    font-weight: 400;
    color: var(--td-text);
    text-align: center;
    margin: 0 0 clamp(24px, 2.4vw, 35px);
    line-height: 1.45;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Form Rows ────────────────────────────────────────────── */
.td-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(14px, 1.8vw, 42px) 17px;
    margin-bottom: clamp(14px, 1.8vw, 42px);
}

.td-form-row--full {
    grid-template-columns: 1fr;
}

.td-field {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.td-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1E1E1E;
    line-height: 1.25;
}

/* ── Inputs ───────────────────────────────────────────────── */
.td-input {
    width: 100%;
    height: 47px;
    padding: 0 14px;
    background: var(--td-input-bg);
    border: 1px solid var(--td-border);
    border-radius: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #1E1E1E;
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
}

.td-input::placeholder {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(30, 30, 30, 0.5);
    opacity: 1;
}

.td-input::-webkit-input-placeholder {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(30, 30, 30, 0.5);
    opacity: 1;
}

.td-input::-moz-placeholder {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(30, 30, 30, 0.5);
    opacity: 1;
}

.td-input:focus {
    border-color: #888;
    background: var(--td-input-bg);
}

.td-input.td-input--error {
    border-color: #c53030;
}

/* ── Phone prefix ─────────────────────────────────────────── */
.td-phone-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--td-border);
    border-radius: 0;
    background: var(--td-input-bg);
    overflow: hidden;
    transition: border-color 0.2s;
}

.td-phone-wrap:focus-within {
    border-color: #888;
}

.td-phone-wrap.td-input--error {
    border-color: #c53030;
}

.td-phone-prefix {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    background: var(--td-phone-bg);
    border-right: 1px solid var(--td-border);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1E1E1E;
    white-space: nowrap;
    flex-shrink: 0;
}

.td-flag {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 0;
    display: block;
    flex-shrink: 0;
}

.td-phone-input {
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    flex: 1;
    height: 47px;
}

/* ── Select ───────────────────────────────────────────────── */
.td-select-wrap {
    position: relative;
}

.td-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13L6 7H14L10 13Z' fill='black'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px 20px;
    padding-right: 36px;
    cursor: pointer;
    color: #1E1E1E;
}

.td-select.is-placeholder {
    color: rgba(30, 30, 30, 0.5);
    font-weight: 500;
}

.td-select option {
    color: #1E1E1E;
    font-weight: 500;
}

.td-select option[value=""] {
    color: rgba(30, 30, 30, 0.5);
}

.td-select:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ── Date input ───────────────────────────────────────────── */
.td-date-wrap {
    position: relative;
    border: 1px solid var(--td-border);
    background: var(--td-input-bg);
}

.td-date-wrap:focus-within {
    border-color: #888;
}

.td-date-wrap.is-error {
    border-color: #c53030;
}

.td-date-input.td-input {
    position: relative;
    z-index: 2;
    border: none !important;
    background: transparent !important;
    color: transparent;
    padding-right: 40px;
    box-shadow: none;
    cursor: pointer;
}

.td-date-input.has-value {
    color: #1E1E1E !important;
}

.td-date-input:focus:not(.has-value) {
    color: transparent !important;
}

.td-date-input::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
}

.td-date-placeholder {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: rgba(30, 30, 30, 0.5);
    pointer-events: none;
    z-index: 1;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.td-date-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.td-date-icon svg {
    width: 17px;
    height: 17px;
    display: block;
}

.td-date-wrap.is-filled .td-date-placeholder {
    display: none;
}

/* ── Error messages ───────────────────────────────────────── */
.td-error {
    font-size: 0.75rem;
    color: #c53030;
    min-height: 0;
    display: block;
}

.td-field:has(.td-error:not(:empty)) {
    gap: 6px;
}

/* ── Submit button ────────────────────────────────────────── */
.td-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 452px;
    max-width: 100%;
    height: 48px;
    margin: 12px auto 0;
    background: var(--td-text);
    color: #fff;
    border: none;
    border-radius: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.15s ease;
    box-sizing: border-box;
}

.td-submit-btn:hover {
    background: #000;
}

.td-submit-btn:hover .btn-cta-icon {
    width: 24px;
    margin-left: 8px;
    opacity: 1;
}

.td-submit-btn:hover .btn-cta-icon__dash {
    opacity: 1;
}

.td-submit-btn:hover .btn-cta-icon__arrow {
    opacity: 1;
    transition-delay: 0.22s;
}

.td-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.td-submit-btn:disabled:hover .btn-cta-icon {
    width: 0;
    margin-left: 0;
    opacity: 0;
}

.td-submit-btn.is-loading .btn-cta-icon {
    display: none;
}

.td-spinner {
    animation: tdSpin 0.8s linear infinite;
}

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

/* ── Success panel ────────────────────────────────────────── */
.td-success-panel {
    text-align: center;
    padding: 20px 0;
    animation: tdFadeIn 0.4s ease both;
}

.td-success-icon {
    margin-bottom: 20px;
}

.td-success-title {
    font-size: clamp(20px, 1.67vw, 24px);
    font-weight: 700;
    color: var(--td-text);
    margin-bottom: 10px;
}

.td-success-msg {
    font-size: clamp(14px, 1.11vw, 16px);
    color: var(--td-text);
    margin-bottom: 28px;
    line-height: 1.55;
}

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

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .td-form-row {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }

    .td-hero__inner {
        padding: 12px 16px 0;
    }

    .td-submit-btn {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .td-form-card {
        padding: 24px 16px 20px;
    }
}
