/* =============================================================================
   FORMS & MODALS — Enquiry modal, contact forms, inputs
   ============================================================================= */

/* Generic form fields */
.ac-form-group { margin-bottom: 18px; }
.ac-form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--ac-text); margin-bottom: 6px; }
.ac-form-control {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--ac-border); border-radius: var(--ac-radius);
    font-size: .9rem; color: var(--ac-text); background: var(--ac-white);
    transition: border-color var(--ac-transition); font-family: inherit;
}
.ac-form-control:focus { outline: none; border-color: var(--ac-accent); box-shadow: 0 0 0 3px rgba(232,197,71,.15); }
.ac-form-control::placeholder { color: var(--ac-muted); }
textarea.ac-form-control { resize: vertical; min-height: 100px; }
.ac-form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Enquiry modal */
.ac-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 500;
    opacity: 0; visibility: hidden; transition: all var(--ac-transition);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.ac-modal-backdrop.open { opacity: 1; visibility: visible; }
.ac-modal {
    background: var(--ac-white); border-radius: var(--ac-radius-lg);
    width: 100%; max-width: 540px; max-height: 90dvh; overflow-y: auto;
    transform: scale(.95) translateY(12px); transition: transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow: var(--ac-shadow-lg);
}
.ac-modal-backdrop.open .ac-modal { transform: scale(1) translateY(0); }
.ac-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--ac-border);
    position: sticky; top: 0; background: var(--ac-white); z-index: 1;
}
.ac-modal-header h2 { font-size: 1.1rem; }
.ac-modal-car-title { font-size: .82rem; color: var(--ac-muted); margin-top: 4px; }
.ac-modal-car-title:empty { display: none; }
.ac-modal-close {
    width: 34px; height: 34px; border-radius: 50%; background: var(--ac-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--ac-text); cursor: pointer; transition: background var(--ac-transition);
}
.ac-modal-close:hover { background: var(--ac-border); }
.ac-modal-body { padding: 24px; }

/* Alerts */
.ac-alert { padding: 14px 16px; border-radius: var(--ac-radius); margin-bottom: 16px; font-size: .9rem; display: flex; align-items: flex-start; gap: 10px; }
.ac-alert--success { background: #dcfce7; color: #15803d; border-left: 4px solid #22c55e; }
.ac-alert--error   { background: #fee2e2; color: #b91c1c; border-left: 4px solid #ef4444; }
.ac-alert--info    { background: #dbeafe; color: #1d4ed8; border-left: 4px solid #3b82f6; }

/* Enquiry shortcode wrapper */
.ac-enquiry-shortcode-wrap { background: var(--ac-white); border-radius: var(--ac-radius-lg); box-shadow: var(--ac-shadow); padding: 32px; }
.ac-enquiry-shortcode-wrap h3 { font-size: 1.3rem; margin-bottom: 6px; }
.ac-enquiry-subtitle { color: var(--ac-muted); font-size: .9rem; margin-bottom: 24px; }

@media (max-width: 600px) { .ac-form-row-2 { grid-template-columns: 1fr; } }

/* =============================================================================
   MODAL FORM — the enquiry/test-drive form used inside the popup modal.
   This must be self-contained here (not in contact.css) because contact.css
   is only enqueued on the Contact page template, while this modal can be
   opened from any page on the site.
   ============================================================================= */
.ac-modal-testdrive-fields[hidden] { display: none; }

.ac-form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.ac-field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
}
.ac-field-group label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #555;
}
.ac-field-group label .req { color: #D2091A; margin-left: 2px; }

.ac-contact-form input[type="text"],
.ac-contact-form input[type="email"],
.ac-contact-form input[type="tel"],
.ac-contact-form input[type="date"],
.ac-contact-form select,
.ac-contact-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: .9rem;
    font-family: 'Lato', sans-serif;
    color: #111;
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
}
.ac-contact-form input::placeholder,
.ac-contact-form textarea::placeholder { color: #bbb; }
.ac-contact-form input:focus,
.ac-contact-form select:focus,
.ac-contact-form textarea:focus {
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}
.ac-contact-form textarea { min-height: 100px; resize: vertical; }

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

.ac-form-privacy {
    font-size: .85rem;
    color: #555;
    line-height: 1.75;
    margin-bottom: 20px;
}
.ac-form-privacy a { color: #111; text-decoration: underline; }

.ac-form-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .84rem;
    color: #444;
    margin-bottom: 24px;
    cursor: pointer;
    line-height: 1.5;
}
.ac-form-consent input[type="checkbox"] {
    width: 16px; height: 16px; min-width: 16px;
    margin-top: 2px; accent-color: #111; cursor: pointer;
    padding: 0; border: 1px solid #ccc;
}

.ac-form-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 36px;
    background: #111;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background .2s;
    font-family: 'Lato', sans-serif;
}
.ac-form-submit:hover { background: #333; }
.ac-form-submit:disabled { opacity: .6; cursor: not-allowed; }

.ac-spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
    border-radius: 50%; animation: ac-spin .6s linear infinite;
}
@keyframes ac-spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
    .ac-form-row-3 { grid-template-columns: 1fr; }
}

.ac-form-message:empty { display: none; }
