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

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

/* ── 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) 15px 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-size: clamp(13px, 0.97vw, 14px);
    font-weight: 700;
    color: var(--td-text);
    line-height: 1.25;
}

/* ── Inputs ───────────────────────────────────────────────── */
.td-input {
    width: 100%;
    height: 47px;
    padding: 0 14px;
    background: transparent;
    border: 1px solid var(--td-border);
    border-radius: 0;
    font-family: inherit;
    font-size: clamp(13px, 0.97vw, 14px);
    color: var(--td-text);
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.td-input::placeholder {
    color: var(--td-placeholder);
    font-weight: 400;
}

.td-input:focus {
    border-color: var(--td-text);
    background: transparent;
}

.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: transparent;
    overflow: hidden;
    transition: border-color 0.2s;
}

.td-phone-wrap:focus-within {
    border-color: var(--td-text);
}

.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-text);
    font-size: clamp(13px, 0.97vw, 14px);
    font-weight: 600;
    color: var(--td-text);
    white-space: nowrap;
    flex-shrink: 0;
}

.td-flag {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 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 {
    padding-right: 36px;
    cursor: pointer;
    color: var(--td-placeholder);
}

.td-select:valid,
.td-select option:not([value=""]) {
    color: var(--td-text);
}

.td-select-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.td-select-icon path {
    stroke: var(--td-text);
}

/* ── Date input ───────────────────────────────────────────── */
.td-date-wrap {
    position: relative;
}

.td-date-input {
    color: transparent;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.td-date-input:focus,
.td-date-input:valid {
    color: var(--td-text);
}

.td-date-input:focus + .td-date-placeholder,
.td-date-input:valid + .td-date-placeholder {
    display: none;
}

.td-date-placeholder {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(13px, 0.97vw, 14px);
    color: var(--td-placeholder);
    pointer-events: none;
    z-index: 1;
}

.td-date-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

.td-date-icon rect,
.td-date-icon path {
    stroke: var(--td-text);
}

.td-date-input::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 40px;
    height: 100%;
    cursor: pointer;
}

/* ── 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;
    width: 100%;
    max-width: 452px;
    height: 48px;
    margin: 4px auto 0;
    background: var(--td-text);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: clamp(13px, 0.97vw, 14px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

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

.td-submit-btn:active {
    transform: scale(0.99);
}

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

.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 12px 0;
    }

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

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