/* ============================================================
   VALUATION FORM MODAL — BATTEL PREMIUM DESIGN
   ============================================================ */
:root {
    --bv-radius: 14px;
    --bv-input-h: 56px;
    --bv-panel-radius: 20px;
}


/* --- OVERLAY & MODAL CONTAINER --- */
.bv-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(10, 25, 41, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    padding: 20px;
}

.bv-overlay.bv-visible {
    opacity: 1;
    visibility: visible;
}

.bv-modal {
    background: #fff;
    border-radius: 32px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.25);
    transform: translateY(30px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.bv-overlay.bv-visible .bv-modal {
    transform: translateY(0) scale(1);
}

/* Custom scrollbar */
.bv-modal::-webkit-scrollbar { width: 6px; }
.bv-modal::-webkit-scrollbar-track { background: transparent; }
.bv-modal::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* --- CLOSE BUTTON --- */
.bv-close {
    position: sticky;
    top: 16px;
    float: right;
    margin: 16px 16px 0 0;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.bv-close:hover {
    background: #fecaca;
    color: #D91E36;
    border-color: #fca5a5;
    transform: rotate(90deg);
}

/* --- HEADER --- */
.bv-header {
    padding: 40px 48px 0;
    text-align: center;
}

.bv-header-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #D91E36, #FF6B35);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(217, 30, 54, 0.3);
}

.bv-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #0A1929;
    margin-bottom: 8px;
    line-height: 1.2;
}

.bv-header p {
    font-size: 15px;
    color: #64748b;
    margin-bottom: 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* --- STEP INDICATOR --- */
.bv-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 28px 48px 0;
}

.bv-step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: #94a3b8;
    transition: all 0.4s;
    flex-shrink: 0;
}

.bv-step-dot.active {
    background: #0A1929;
    border-color: #0A1929;
    color: #fff;
    box-shadow: 0 4px 12px rgba(10, 25, 41, 0.3);
}

.bv-step-dot.done {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.bv-step-line {
    width: 60px;
    height: 2px;
    background: #e2e8f0;
    transition: background 0.4s;
}

.bv-step-line.done {
    background: #10b981;
}

/* --- FORM BODY --- */
.bv-body {
    padding: 32px 48px 48px;
}

.bv-section {
    display: none;
    animation: bvFadeIn 0.4s ease;
}

.bv-section.active {
    display: block;
}

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

/* --- LOGIN PROMPT (Guest) --- */
.bv-login-prompt {
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.bv-login-prompt i {
    font-size: 28px;
    color: #3b82f6;
}

.bv-login-prompt p {
    font-size: 14px;
    color: #1e40af;
    margin: 0;
}

.bv-login-prompt a {
    color: #D91E36;
    font-weight: 700;
    text-decoration: none;
}

.bv-login-prompt a:hover {
    text-decoration: underline;
}

/* --- FORM FIELDS --- */
.bv-field {
    margin-bottom: 24px;
}

.bv-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bv-field label .required {
    color: #D91E36;
    margin-left: 2px;
}

.bv-field label .recommended {
    color: #f59e0b;
    font-size: 11px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 8px;
}

html body div.bv-overlay div.bv-modal input.bv-input, 
html body div.bv-overlay div.bv-modal select.bv-input, 
html body div.bv-overlay div.bv-modal textarea.bv-input, 
html body div.bv-overlay div.bv-modal .bv-input {
    width: 100% !important;
    height: 56px !important;
    padding: 0 20px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 14px !important;
    font-size: 16px !important;
    color: #0f172a !important;
    background: #f8fafc !important;
    outline: none !important;
    transition: all 0.3s !important;
    font-family: 'Inter', sans-serif !important;
    box-sizing: border-box !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

html body div.bv-overlay div.bv-modal textarea.bv-input {
    height: auto !important;
    padding: 16px 20px !important;
    resize: vertical !important;
    min-height: 120px !important;
}

.bv-input:focus {
    border-color: #0A1929;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(10, 25, 41, 0.08);
}

.bv-input.error {
    border-color: #D91E36;
    background: #fff1f2;
    box-shadow: 0 0 0 4px rgba(217, 30, 54, 0.1), 0 0 15px rgba(217, 30, 54, 0.2);
    animation: bvShake 0.4s ease-in-out;
}

@keyframes bvShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.bv-input:read-only {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.bv-input.auto-filled {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

html body div.bv-overlay div.bv-modal select.bv-input {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    padding-right: 44px !important;
    line-height: 52px !important;
}

.bv-field-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

.bv-field-error {
    font-size: 12px;
    color: #D91E36;
    margin-top: 6px;
    display: none;
}

.bv-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* --- PHONE INPUT WITH INTL-TEL-INPUT --- */
.bv-phone-wrapper {
    width: 100% !important;
    position: relative;
    display: block !important;
}

/* Ensure the library wrapper takes full width */
.iti { 
    display: block !important; 
    width: 100% !important; 
}

.iti__flag-container {
    padding: 2px !important;
}

/* Fix input padding to accommodate the selected flag */
html body div.bv-overlay div.bv-modal .iti input.bv-phone-number {
    padding-left: 95px !important; /* Space for separateDialCode flag + code */
    width: 100% !important;
    flex: none !important;
}

/* Style the dropdown to match theme */
.iti__country-list {
    z-index: 100000 !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    font-family: 'Inter', sans-serif !important;
    max-width: 300px;
}

/* --- PLATE INPUT (HERO-LIKE) --- */
.bv-plate-group {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--bv-panel-radius);
    padding: 28px;
    margin-bottom: 24px;
    text-align: center;
    transition: all 0.4s;
}

.bv-plate-group:focus-within {
    border-color: #0A1929;
    box-shadow: 0 0 0 4px rgba(10, 25, 41, 0.08);
}

.bv-plate-group label {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #0A1929;
    display: block;
    margin-bottom: 16px;
}

.bv-plate-input-row {
    display: flex;
    gap: 12px;
    max-width: 420px;
    margin: 0 auto;
}

.bv-plate-input {
    flex: 1;
    height: 64px; /* Un po' più alto per enfasi, ma con raggio coerente */
    padding: 0 20px;
    border: 2px solid #e2e8f0;
    border-radius: var(--bv-radius);
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #0A1929;
    background: #fff;
    outline: none;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
}

.bv-plate-input:focus {
    border-color: #0A1929;
    box-shadow: 0 0 0 4px rgba(10, 25, 41, 0.08);
}

.bv-plate-btn {
    height: 64px; /* Allineato all'input targa */
    padding: 0 24px;
    background: #0A1929;
    color: #fff;
    border: none;
    border-radius: var(--bv-radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.bv-plate-btn:hover {
    background: #1e293b;
    transform: translateY(-2px);
}

.bv-plate-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.bv-plate-hint {
    margin-top: 12px;
    font-size: 13px;
    color: #94a3b8;
}

.bv-plate-hint.error {
    color: #D91E36;
}

.bv-manual-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 14px;
    color: #3b82f6;
    cursor: pointer;
    font-weight: 600;
    border: none;
    background: none;
    padding: 0;
    transition: color 0.3s;
}

.bv-manual-toggle:hover {
    color: #1d4ed8;
}

/* --- VEHICLE DATA CARD (populated by API) --- */
.bv-vehicle-card {
    background: #f8fafc;
    border-radius: var(--bv-panel-radius);
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    display: none;
}

.bv-vehicle-card.active {
    display: block;
    animation: bvFadeIn 0.5s ease;
}

.bv-vehicle-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.bv-vehicle-badge {
    background: #ecfdf5;
    color: #059669;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bv-vehicle-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #0A1929;
}

.bv-vehicle-subtitle {
    font-size: 14px;
    color: #64748b;
}

.bv-vehicle-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.bv-spec-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.bv-spec-item i {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 14px;
    flex-shrink: 0;
}

.bv-spec-item-label {
    color: #94a3b8;
    font-size: 11px;
    text-transform: uppercase;
    display: block;
}

.bv-spec-item-value {
    color: #0f172a;
    font-weight: 600;
    display: block;
}

/* --- SHIMMER LOADING ANIMATION --- */
.bv-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: bvShimmer 1.5s infinite;
    border-radius: 8px;
    height: 20px;
    margin-bottom: 8px;
}

@keyframes bvShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* --- PHOTO UPLOAD (Drag & Drop) --- */
.bv-photo-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafbfc;
    position: relative;
}

.bv-photo-zone:hover,
.bv-photo-zone.dragover {
    border-color: #D91E36;
    background: #fef2f2;
}

.bv-photo-zone i {
    font-size: 36px;
    color: #cbd5e1;
    margin-bottom: 12px;
    display: block;
}

.bv-photo-zone p {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 4px;
}

.bv-photo-zone span {
    font-size: 12px;
    color: #94a3b8;
}

.bv-photo-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.bv-photo-previews {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 16px;
}

.bv-photo-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--bv-radius);
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.bv-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bv-photo-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(217, 30, 54, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.bv-photo-thumb-remove:hover {
    transform: scale(1.15);
}

.bv-photo-count {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    margin-top: 12px;
}

.bv-photo-count strong {
    color: #059669;
}

/* --- PRIVACY CHECKBOX --- */
.bv-privacy {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    background: #f8fafc;
    border-radius: var(--bv-radius);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.bv-privacy input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: #D91E36;
    flex-shrink: 0;
}

.bv-privacy label {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    margin-bottom: 0;
}

.bv-privacy label a {
    color: #D91E36;
    text-decoration: none;
    font-weight: 600;
}

/* --- CTA BUTTONS --- */
.bv-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.bv-btn {
    flex: 1;
    height: var(--bv-input-h);
    padding: 0 24px;
    border-radius: var(--bv-radius);
    font-size: 16px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bv-btn-back {
    background: #f1f5f9;
    color: #475569;
    flex: 0 0 auto;
    padding: 18px 28px;
}

.bv-btn-back:hover {
    background: #e2e8f0;
}

.bv-btn-next {
    background: #0A1929;
    color: #fff;
    box-shadow: 0 10px 20px rgba(10, 25, 41, 0.2);
}

.bv-btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(10, 25, 41, 0.3);
}

.bv-btn-submit {
    background: linear-gradient(135deg, #D91E36, #FF6B35);
    color: #fff;
    box-shadow: 0 10px 20px rgba(217, 30, 54, 0.3);
}

.bv-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(217, 30, 54, 0.4);
}

.bv-btn:disabled {
    opacity: 0.4;
    cursor: default;
    filter: grayscale(0.5);
    background: #94a3b8 !important;
    box-shadow: none !important;
    transform: none !important;
}

/* --- SUCCESS STATE --- */
.bv-success {
    text-align: center;
    padding: 40px 20px;
}

.bv-success-icon {
    width: 80px;
    height: 80px;
    background: #ecfdf5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 36px;
    color: #10b981;
    animation: bvPop 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes bvPop {
    0% { transform: scale(0); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.bv-success h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #0A1929;
    margin-bottom: 12px;
}

.bv-success p {
    font-size: 15px;
    color: #64748b;
    margin-bottom: 32px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.bv-success-wa {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: #25D366;
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3);
    transition: all 0.3s;
}

.bv-success-wa:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(37, 211, 102, 0.4);
    color: #fff;
}

/* --- TRIGGER BUTTON ON EMAIL CARD --- */
.bv-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(217, 30, 54, 0.08);
    color: #D91E36;
    border: 1px solid rgba(217, 30, 54, 0.2);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
    text-decoration: none;
}

.bv-trigger-btn:hover {
    background: #D91E36;
    color: #fff;
    border-color: #D91E36;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .bv-modal {
        border-radius: 24px;
        max-height: 95vh;
    }
    .bv-header { padding: 28px 24px 0; }
    .bv-header h2 { font-size: 22px; }
    .bv-body { padding: 24px 24px 32px; }
    .bv-steps { padding: 20px 24px 0; }
    .bv-row { grid-template-columns: 1fr; }
    .bv-plate-input-row { flex-direction: column; }
    .bv-plate-input { font-size: 18px; }
    .bv-photo-previews { grid-template-columns: repeat(3, 1fr); }
    .bv-vehicle-specs { grid-template-columns: 1fr; }
    .bv-actions { flex-direction: column; }
    .bv-btn-back { order: 2; }
}

/* --- DELIVERY METHOD RADIO CARDS --- */
.bv-consegna-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .bv-consegna-group {
        grid-template-columns: 1fr;
    }
}

.bv-radio-card {
    cursor: pointer;
    display: block;
    margin-bottom: 0 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 400 !important;
}

.bv-radio-card input[type="radio"] {
    display: none;
}

.bv-radio-card-body {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bv-radio-card-body i {
    font-size: 24px;
    color: #94a3b8;
    width: 44px;
    height: 44px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.bv-radio-card-body strong {
    display: block;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 2px;
    font-weight: 700;
}

.bv-radio-card-body span {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

.bv-radio-card:hover .bv-radio-card-body {
    border-color: #cbd5e1;
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.bv-radio-card input[type="radio"]:checked + .bv-radio-card-body {
    border-color: #0A1929;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(10, 25, 41, 0.08), 0 8px 20px rgba(10, 25, 41, 0.08);
}

.bv-radio-card input[type="radio"]:checked + .bv-radio-card-body i {
    background: #0A1929;
    color: #fff;
}

/* --- ERROR HIGHLIGHTS FOR CONSEGNA AND PRIVACY --- */
.bv-consegna-error .bv-radio-card-body {
    border-color: #D91E36 !important;
    background: #fff1f2 !important;
    box-shadow: 0 0 0 3px rgba(217, 30, 54, 0.1) !important;
}

.bv-privacy-error {
    border-color: #D91E36 !important;
    background: #fff1f2 !important;
    box-shadow: 0 0 0 3px rgba(217, 30, 54, 0.1) !important;
    animation: bvShake 0.4s ease-in-out;
}
