/* ============================================
   PLATE SEARCH — Premium Plate Field + Modal
   ============================================ */

/* --- Campo Targa Premium --- */
.bp-plate-field-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 8px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.bp-plate-field-wrap:focus-within {
    border-color: #002266;
    box-shadow: 0 0 0 2px #002266, 0 0 0 6px rgba(0, 34, 102, 0.15);
}

.bp-plate-eu-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 28px;
    min-width: 28px;
    align-self: stretch;
    background: linear-gradient(180deg, #0d47a1, #082f6e);
    border-radius: 0;
    color: #fff;
    padding: 6px 0 4px 0;
    flex-shrink: 0;
    position: relative;
    box-shadow: inset -1px 0 2px rgba(0, 0, 0, 0.2);
}

.bp-plate-eu-stars {
    width: 14px;
    height: 14px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="%23fcd116" stroke-width="8" stroke-dasharray="0.1 20.94" stroke-linecap="round"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.bp-plate-country-code {
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    font-family: 'Arial', sans-serif;
    line-height: 1;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.bp-plate-input {
    flex: 1;
    border: none !important;
    background: #f8fafc !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    letter-spacing: 0.15em !important;
    text-transform: uppercase !important;
    color: #1a365d !important;
    padding: 10px 15px !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: 'Inter', 'Roboto Mono', 'Monaco', monospace !important;
    height: 44px;
}

.bp-plate-input::placeholder {
    color: #94a3b8 !important;
    font-weight: 600 !important;
    letter-spacing: 0.1em !important;
}

.bp-plate-search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 24px;
    margin: 0;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.bp-plate-search-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.bp-plate-search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.bp-hint-error {
    color: #dc2626 !important;
    font-weight: 600;
}

/* Gate login */
.bp-plate-login-gate {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 10px;
    font-size: 13px;
    color: #92400e;
}

.bp-plate-login-gate i {
    font-size: 18px;
    color: #f59e0b;
}

.bp-plate-login-gate a {
    color: #dc2626;
    font-weight: 700;
    text-decoration: none;
}

.bp-plate-login-gate a:hover {
    text-decoration: underline;
}

/* --- Modale / Popup --- */
.bpm-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(10, 25, 41, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.bpm-overlay.bpm-visible {
    opacity: 1;
    pointer-events: all;
}

.bpm-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.bpm-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.bpm-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Header */
.bpm-header {
    background: linear-gradient(135deg, #0a1929 0%, #1a365d 100%);
    padding: 28px 28px 24px;
    border-radius: 20px 20px 0 0;
    text-align: center;
}

.bpm-header-plate {
    margin-bottom: 16px;
}

.bpm-plate-badge {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid #333;
}

.bpm-plate-eu {
    background: linear-gradient(135deg, #003399, #0044cc);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 8px;
}

.bpm-plate-text {
    padding: 6px 16px;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: #0a1929;
    font-family: 'Inter', monospace;
}

.bpm-title {
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 4px;
    font-family: 'Montserrat', sans-serif;
}

.bpm-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0 0 12px;
}

.bpm-tags {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bpm-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.bpm-tag-ktype {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.bpm-tag-source {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* VIN */
.bpm-vin {
    padding: 10px 28px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    color: #64748b;
    font-family: monospace;
}

/* Specs Grid */
.bpm-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #e2e8f0;
    margin: 0;
}

.bpm-spec {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #fff;
}

.bpm-spec-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.bpm-spec-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bpm-spec-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bpm-spec-value {
    font-size: 13px;
    font-weight: 700;
    color: #0a1929;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Matching */
.bpm-match {
    margin: 0;
    padding: 20px 28px;
    background: #f0fdf4;
    border-top: 1px solid #bbf7d0;
}

.bpm-match-title {
    font-size: 14px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bpm-match-grid {
    display: flex;
    gap: 12px;
}

.bpm-match-item {
    flex: 1;
    text-align: center;
    padding: 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #bbf7d0;
}

.bpm-match-count {
    display: block;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.bpm-match-ricambi .bpm-match-count {
    color: #dc2626;
}

.bpm-match-veicoli .bpm-match-count {
    color: #1e40af;
}

.bpm-match-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.bpm-match-empty {
    background: #fffbeb;
    border-top-color: #fde68a;
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
}

.bpm-match-empty i {
    color: #f59e0b;
    margin-right: 4px;
}

/* Actions */
.bpm-actions {
    display: flex;
    gap: 10px;
    padding: 20px 28px 28px;
}

.bpm-btn {
    flex: 1;
    padding: 14px 16px;
    border-radius: 12px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.bpm-btn-red {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
}

.bpm-btn-red:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

.bpm-btn-navy {
    background: linear-gradient(135deg, #0a1929, #1a365d);
    color: #fff;
}

.bpm-btn-navy:hover {
    background: linear-gradient(135deg, #1a365d, #234876);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 25, 41, 0.3);
}

/* Admin info */
.bpm-admin-info {
    padding: 8px 28px 16px;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .bpm-modal {
        max-width: 100%;
        border-radius: 16px;
    }

    .bpm-specs {
        grid-template-columns: 1fr;
    }

    .bpm-actions {
        flex-direction: column;
    }

    .bpm-match-grid {
        flex-direction: column;
    }

    .bp-plate-search-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .bp-plate-search-btn span.bp-plate-btn-text {
        display: none;
    }
}

/* ============================================
   GARAGE PAGE — Il Mio Garage
   ============================================ */

.garage-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.garage-header {
    text-align: center;
    margin-bottom: 40px;
}

.garage-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: #0a1929;
    margin-bottom: 8px;
}

.garage-header p {
    color: #64748b;
    font-size: 16px;
}

.garage-empty {
    text-align: center;
    padding: 60px 30px;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
}

.garage-empty i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.garage-empty h3 {
    color: #64748b;
    font-weight: 700;
    margin-bottom: 8px;
}

.garage-empty p {
    color: #94a3b8;
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

.garage-grid {
    display: grid;
    gap: 20px;
}

.garage-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.garage-card:hover {
    border-color: #dc2626;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.garage-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #0a1929, #1a365d);
    color: #fff;
}

.garage-card-plate-realistic {
    position: relative;
    display: flex;
    align-items: stretch;
    background: #e2e4e6;
    border: 2px solid #0a0a0a;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px #ffffff, 0 2px 6px rgba(0, 0, 0, 0.1);
    height: 32px;
    overflow: hidden;
    flex-shrink: 0;
}

.garage-plate-band {
    width: 22px;
    background: linear-gradient(180deg, #0d47a1, #082f6e);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0 3px 0;
    flex-shrink: 0;
    box-shadow: inset -1px 0 2px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.garage-plate-band-left {
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.garage-plate-band-right {
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: inset 1px 0 2px rgba(0, 0, 0, 0.2);
}

.garage-plate-eu-stars {
    width: 10px;
    height: 10px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="%23fcd116" stroke-width="8" stroke-dasharray="0.1 20.94" stroke-linecap="round"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.garage-plate-country-code {
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    font-family: 'Arial', sans-serif;
    line-height: 1;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.garage-plate-text-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 10px;
    z-index: 1;
}

.garage-plate-text {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #111;
    font-family: 'Inter', 'Arial', monospace;
    line-height: 1;
    display: inline-block;
    margin-top: 3px;
}

.garage-plate-band-right::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    margin-top: 3px;
}

.garage-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.garage-card-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 2px;
    line-height: 1.2;
}

.garage-card-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.garage-card-ktype {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.3);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.garage-remove-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.garage-remove-btn:hover {
    background: rgba(220, 38, 38, 0.8);
    color: #fff;
    transform: rotate(90deg);
}

.garage-remove-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.garage-card-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 20px 24px;
}

.garage-card-spec {
    display: flex;
    align-items: center;
    gap: 8px;
}

.garage-card-spec i {
    color: #dc2626;
    font-size: 13px;
    width: 16px;
    text-align: center;
}

.garage-card-spec-label {
    font-size: 11px;
    color: #94a3b8;
    display: block;
}

.garage-card-spec-value {
    font-size: 13px;
    font-weight: 700;
    color: #0a1929;
}

.garage-card-footer {
    display: flex;
    gap: 10px;
    padding: 0 24px 20px;
}

.garage-card-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.garage-card-btn-red {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
}

.garage-card-btn-red:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-1px);
    color: #fff;
}

.garage-card-btn-outline {
    background: #fff;
    color: #0a1929;
    border: 1px solid #e2e8f0;
}

.garage-card-btn-outline:hover {
    border-color: #0a1929;
    color: #0a1929;
}

.garage-card-date {
    padding: 0 24px 16px;
    font-size: 11px;
    color: #94a3b8;
}

.garage-card-date i {
    margin-right: 4px;
}