/**
 * Cardealer Powersuite – Public Lead Form Styles
 */

:root {
    --cdps-primary: #C9002C;
    --cdps-secondary: #1a1a2e;
    --cdps-success: #198754;
    --cdps-error: #dc3545;
    --cdps-border: #dee2e6;
    --cdps-bg-light: #f8f9fa;
    --cdps-radius: 8px;
}

/* ── Form Wrap ───────────────────────────────────────────────── */
.cdps-lead-form-wrap {
    max-width: 700px;
    margin: 0 auto;
}

.cdps-lead-form-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cdps-lead-form-desc {
    color: #666;
    margin-bottom: 1.5rem;
}

/* ── Form Sections ───────────────────────────────────────────── */
.cdps-form-section {
    margin-bottom: 1.5rem;
}

.cdps-form-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--cdps-primary);
}

/* ── Registration Plate Input ────────────────────────────────── */
.cdps-reg-input-wrap {
    margin-bottom: 0.75rem;
}

.cdps-reg-input-wrap label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cdps-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.cdps-reg-plate {
    display: flex;
    align-items: center;
    border: 2px solid #2b5797;
    border-radius: var(--cdps-radius);
    overflow: hidden;
    background: #fff;
    flex: 1;
    max-width: 220px;
}

.cdps-reg-flag {
    background: #2b5797;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.5rem 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.cdps-reg-plate input {
    border: none;
    outline: none;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0.5rem;
    width: 100%;
    background: transparent;
}

.cdps-reg-plate input::placeholder {
    font-weight: 400;
    letter-spacing: 1px;
    opacity: 0.5;
}

.cdps-lookup-status {
    font-size: 0.875rem;
    min-height: 1.5rem;
}

.cdps-lookup-status.loading {
    color: #666;
}

.cdps-lookup-status.success {
    color: var(--cdps-success);
}

.cdps-lookup-status.error {
    color: var(--cdps-error);
}

/* ── Fields ──────────────────────────────────────────────────── */
.cdps-field {
    margin-bottom: 1rem;
}

.cdps-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.cdps-field input,
.cdps-field select,
.cdps-field textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--cdps-border);
    border-radius: var(--cdps-radius);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.cdps-field input:focus,
.cdps-field select:focus,
.cdps-field textarea:focus {
    border-color: var(--cdps-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 0, 44, 0.1);
}

.cdps-field input[readonly] {
    background: var(--cdps-bg-light);
    color: #495057;
}

.cdps-field input.is-invalid {
    border-color: var(--cdps-error);
}

.cdps-required {
    color: var(--cdps-error);
}

/* ── Grids ───────────────────────────────────────────────────── */
.cdps-vehicle-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.cdps-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.cdps-contact-grid .cdps-field:last-child {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .cdps-vehicle-info-grid,
    .cdps-contact-grid {
        grid-template-columns: 1fr;
    }
    .cdps-contact-grid .cdps-field:last-child {
        grid-column: span 1;
    }
    .cdps-input-group {
        flex-direction: column;
    }
    .cdps-reg-plate {
        max-width: 100%;
    }
}

/* ── GDPR ────────────────────────────────────────────────────── */
.cdps-gdpr-field {
    margin-top: 0.5rem;
}

.cdps-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 400 !important;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.4;
}

.cdps-checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
    flex-shrink: 0;
}

.cdps-checkbox-label a {
    color: var(--cdps-primary);
    text-decoration: underline;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.cdps-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--cdps-radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.cdps-btn-primary {
    background: var(--cdps-primary);
    color: #fff;
}

.cdps-btn-primary:hover {
    background: #a80025;
    color: #fff;
}

.cdps-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.cdps-btn-secondary {
    background: var(--cdps-secondary);
    color: #fff;
}

.cdps-btn-secondary:hover {
    background: #0f0f1e;
    color: #fff;
}

.cdps-btn-secondary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ── Form Actions ────────────────────────────────────────────── */
.cdps-form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.cdps-form-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ddd;
    border-top-color: var(--cdps-primary);
    border-radius: 50%;
    animation: cdps-spin 0.6s linear infinite;
}

@keyframes cdps-spin {
    to { transform: rotate(360deg); }
}

/* ── Messages ────────────────────────────────────────────────── */
.cdps-form-messages {
    margin-top: 1rem;
}

.cdps-message {
    padding: 1rem 1.25rem;
    border-radius: var(--cdps-radius);
    font-size: 0.95rem;
}

.cdps-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.cdps-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ── Hero Variant ────────────────────────────────────────────── */
.cdps-lead-hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
}

.cdps-lead-hero-overlay {
    width: 100%;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.cdps-lead-hero-content {
    max-width: 700px;
    width: 100%;
}

.cdps-lead-hero .cdps-lead-form-title,
.cdps-lead-hero .cdps-lead-form-desc {
    color: #fff;
}

.cdps-lead-hero .cdps-form-section h3 {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.cdps-lead-hero .cdps-field label {
    color: #fff;
}

.cdps-lead-hero .cdps-checkbox-label {
    color: rgba(255, 255, 255, 0.9);
}

.cdps-lead-hero .cdps-checkbox-label a {
    color: #fff;
}

.cdps-lead-hero .cdps-lookup-status {
    color: rgba(255, 255, 255, 0.8);
}

/* ── Modal Adjustments ───────────────────────────────────────── */
.modal .cdps-lead-form-wrap {
    max-width: 100%;
}

.modal .cdps-lead-form-title {
    display: none; /* Title is in modal header */
}

/* ── Brand Cards ─────────────────────────────────────────────── */
.cdps-brands-grid {
    margin: 0 auto;
}

.cdps-brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
    text-decoration: none;
    color: #1a1a2e;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cdps-brand-card:hover {
    border-color: var(--cdps-primary, #2563eb);
    box-shadow: 0 2px 12px rgba(0,0,0,.10);
    color: #1a1a2e;
    text-decoration: none;
}

.cdps-brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.cdps-brand-logo-placeholder {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #9ca3af;
    background: #f3f4f6;
    border-radius: 50%;
}

.cdps-brand-name {
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
    line-height: 1.2;
}

.cdps-brand-count {
    font-size: 0.75rem;
    color: #6b7280;
}

.cdps-brands-summary {
    text-align: center;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.cdps-brands-all-link .section-link {
    font-weight: 500;
}

/* Responsive brand grid */
@media (max-width: 767.98px) {
    .cdps-brands-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    .cdps-brand-logo {
        width: 44px;
        height: 44px;
    }
    .cdps-brand-card {
        padding: 1rem 0.5rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .cdps-brands-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .cdps-brands-grid--archive {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}
