.taxi-calc-root { 
    font-family: 'Segoe UI', sans-serif; 
    max-width:700px; 
    margin:0 auto; 
    padding:20px; 
    background:#1a1a1a; 
    color:#fff; 
    border-radius:12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.taxi-calc-group input, .taxi-calc-group button { 
    padding:12px; 
    width:100%; 
    margin-bottom:10px; 
    border-radius:8px; 
    box-sizing:border-box; 
    font-size:15px;
}
.taxi-calc-group input { border:1px solid #444; background:#fff; color:#000; }
.taxi-calc-group input:focus { outline:none; border-color:#007fc6; box-shadow:0 0 0 3px rgba(0,127,198,0.2); }

#inverti { 
    background:#007fc6; 
    color:#fff; 
    border:none; 
    font-weight:600; 
    cursor:pointer; 
    transition: background 0.2s;
}
#inverti:hover { background:#0069a3; }

/* Nuovi Input Options */
.taxi-calc-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
}
.taxi-option-item { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.taxi-option-item.full-width { flex: 100%; flex-direction: row; align-items: center; }
.taxi-option-item label { font-size: 0.9em; color: #ccc; margin-bottom: 5px; }
.taxi-option-item input[type="number"] { padding: 8px; border-radius: 5px; border: 1px solid #444; width: 100%; box-sizing: border-box; }

/* Checkbox Custom */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 15px;
    user-select: none;
    margin-top: 5px;
}
.checkbox-container input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark { position: absolute; top: 0; left: 0; height: 20px; width: 20px; background-color: #eee; border-radius: 4px; }
.checkbox-container:hover input ~ .checkmark { background-color: #ccc; }
.checkbox-container input:checked ~ .checkmark { background-color: #007fc6; }
.checkmark:after { content: ""; position: absolute; display: none; }
.checkbox-container input:checked ~ .checkmark:after { display: block; }
.checkbox-container .checkmark:after { left: 7px; top: 3px; width: 5px; height: 10px; border: solid white; border-width: 0 3px 3px 0; transform: rotate(45deg); }

/* Mappa */
#taxi-calc-map { height: 400px; border-radius: 8px; margin-bottom: 20px; z-index: 1; }

/* Risultati */
#prezzo-stimato { display: none; margin-top:20px; }
.result-box {
    background: #222;
    border: 1px solid #333;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}
.km-info { font-size: 1.1em; color: #aaa; margin-bottom: 15px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.km-info strong { color: #fff; }
.price-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.price-row .label {
    white-space: nowrap;
    text-align: left;
}

.price-row .value {
    white-space: nowrap;
    text-align: right;
}
.price-row.day { color: #ffd700; }
.price-row.night { color: #a6c0fe; }
.price-row .value { font-weight: bold; font-size: 1.3em; }
.calc-footer { margin-top: 15px; font-size: 0.85em; color: #888; font-style: italic; }

/* Autocomplete */
.autocomplete-list { background:#fff; color:#000; border:1px solid #ccc; z-index:999999; max-height:220px; overflow-y:auto; box-shadow:0 6px 18px rgba(0,0,0,0.35); border-radius:6px; font-size:14px; }
.autocomplete-item { padding:10px 12px; cursor:pointer; border-bottom:1px solid #eee; }
.autocomplete-item:hover, .autocomplete-item.active { background:#eef6fa; color: #000; }

/* ===== v1.4.0: Autocomplete (POI) ===== */
.autocomplete-item { display:flex; gap:10px; align-items:flex-start; }
.autocomplete-item .ac-icon { flex:0 0 auto; width:22px; text-align:center; font-size:16px; line-height:1.3; }
.autocomplete-item .ac-text { min-width:0; }
.autocomplete-item .ac-label { display:block; font-weight:600; }
.autocomplete-item .ac-sub { display:block; font-size:12px; color:#666; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.autocomplete-message { padding:10px 12px; font-size:13px; color:#555; }
.autocomplete-message button { display:inline; margin:6px 0 0; padding:6px 10px; border:none; border-radius:6px; background:#007fc6; color:#fff; cursor:pointer; font-size:13px; }

/* ===== v1.4.0: Form richiesta preventivo (fallback) ===== */
.taxi-fb { margin-top:20px; padding:20px; background:#222; border:1px solid #333; border-radius:12px; }
.taxi-fb[hidden], .taxi-fb [hidden] { display:none !important; }
.taxi-fb-title { margin:0 0 8px; color:#fff !important; font-size:1.3em; }
.taxi-fb-intro, .taxi-fb-phone { margin:0 0 12px; color:#ccc; font-size:0.95em; }
.taxi-fb-form { display:flex; flex-wrap:wrap; gap:12px; }
.taxi-fb-field { flex:1 1 calc(50% - 6px); min-width:140px; display:flex; flex-direction:column; }
.taxi-fb-field.full { flex-basis:100%; }
.taxi-fb-field label { font-size:0.9em; color:#ccc; margin-bottom:4px; }
.taxi-fb-field input[type="text"], .taxi-fb-field input[type="tel"], .taxi-fb-field input[type="email"],
.taxi-fb-field input[type="date"], .taxi-fb-field input[type="time"], .taxi-fb-field input[type="number"],
.taxi-fb-field select, .taxi-fb-field textarea {
    width:100%; box-sizing:border-box; padding:10px; border:1px solid #444; border-radius:8px; background:#fff; color:#000; font-size:15px;
}
.taxi-fb-field [aria-invalid="true"] { border-color:#e5484d; box-shadow:0 0 0 2px rgba(229,72,77,0.25); }
.taxi-fb-error { color:#ff8a8d; font-size:0.85em; margin-top:4px; }
.taxi-fb-privacy label { display:flex; gap:8px; align-items:flex-start; cursor:pointer; }
.taxi-fb-privacy input { margin-top:3px; }
.taxi-fb-privacy a { color:#7cc4f0; }
.taxi-fb-hp { position:absolute !important; left:-9999px !important; width:1px; height:1px; overflow:hidden; }
.taxi-fb-status { flex-basis:100%; padding:10px 12px; border-radius:8px; font-size:0.95em; }
.taxi-fb-status.ok { background:#12351f; color:#9be3b0; }
.taxi-fb-status.ko { background:#3a1618; color:#ff9da0; }
.taxi-fb-submit { width:100%; padding:12px; border:none; border-radius:8px; background:#007fc6; color:#fff; font-weight:600; font-size:15px; cursor:pointer; }
.taxi-fb-submit:hover { background:#0069a3; }
.taxi-fb-submit[disabled] { opacity:0.6; cursor:wait; }

/* ===== v1.4.0 — Autocomplete con POI ===== */
.autocomplete-item { display:flex; align-items:flex-start; gap:10px; }
.autocomplete-item .ac-icon { flex:0 0 auto; width:22px; text-align:center; line-height:1.3; }
.autocomplete-item .ac-text { display:flex; flex-direction:column; min-width:0; }
.autocomplete-item .ac-main { font-weight:600; overflow-wrap:anywhere; }
.autocomplete-item .ac-sub { font-size:12px; color:#666; overflow-wrap:anywhere; }
.autocomplete-message { padding:10px 12px; color:#444; font-size:13px; }
.autocomplete-fallback-btn { margin-top:8px; padding:8px 12px; border:none; border-radius:6px; background:#007fc6; color:#fff; font-weight:600; cursor:pointer; }
.autocomplete-fallback-btn:hover { background:#0069a3; }

/* ===== v1.4.0 — Form richiesta preventivo (fallback) ===== */
.taxi-calc-fallback { margin-top:20px; padding:20px; background:#222; border:1px solid #333; border-radius:12px; }
.taxi-calc-fallback[hidden], .taxi-calc-fallback form[hidden] { display:none; }
.taxi-calc-fallback .tcf-title { margin:0 0 8px; color:#fff; font-size:1.3em; }
.taxi-calc-fallback .tcf-intro { margin:0 0 12px; color:#ccc; }
.taxi-calc-fallback .tcf-phone { margin:0 0 16px; color:#ccc; }
.taxi-calc-fallback .tcf-phone a { color:#ffd700; }
.taxi-calc-fallback .tcf-row { display:flex; flex-direction:column; margin-bottom:12px; min-width:0; }
.taxi-calc-fallback .tcf-row label { font-size:0.9em; color:#ccc; margin-bottom:5px; }
.taxi-calc-fallback .tcf-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.taxi-calc-fallback .tcf-grid.tcf-grid-2 { grid-template-columns:repeat(2,1fr); }
.taxi-calc-fallback input[type="text"],
.taxi-calc-fallback input[type="email"],
.taxi-calc-fallback input[type="tel"],
.taxi-calc-fallback input[type="date"],
.taxi-calc-fallback input[type="time"],
.taxi-calc-fallback input[type="number"],
.taxi-calc-fallback select,
.taxi-calc-fallback textarea { width:100%; box-sizing:border-box; padding:10px; border:1px solid #444; border-radius:6px; background:#fff; color:#000; font-size:15px; font-family:inherit; }
.taxi-calc-fallback input:focus,
.taxi-calc-fallback select:focus,
.taxi-calc-fallback textarea:focus { outline:none; border-color:#007fc6; box-shadow:0 0 0 3px rgba(0,127,198,0.2); }
.taxi-calc-fallback [aria-invalid="true"] { border-color:#e5484d; }
.taxi-calc-fallback .tcf-error { color:#ff8a8d; font-size:0.85em; margin-top:4px; }
.taxi-calc-fallback .tcf-privacy label { display:flex; align-items:flex-start; gap:8px; font-size:0.9em; color:#ccc; cursor:pointer; }
.taxi-calc-fallback .tcf-privacy input { margin-top:3px; }
.taxi-calc-fallback .tcf-privacy a { color:#ffd700; }
.taxi-calc-fallback .tcf-hp { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }
.taxi-calc-fallback .tcf-message { min-height:1.2em; margin-bottom:10px; font-size:0.95em; }
.taxi-calc-fallback .tcf-message.error { color:#ff8a8d; }
.taxi-calc-fallback .tcf-submit { width:100%; padding:12px; border:none; border-radius:8px; background:#007fc6; color:#fff; font-size:15px; font-weight:600; cursor:pointer; transition:background 0.2s; }
.taxi-calc-fallback .tcf-submit:hover { background:#0069a3; }
.taxi-calc-fallback .tcf-submit:disabled { opacity:0.6; cursor:wait; }
.taxi-calc-fallback .tcf-success { padding:16px; border-radius:8px; background:#12351f; border:1px solid #1f6b3a; color:#d6f5e0; }
@media (max-width:600px) {
	.taxi-calc-fallback .tcf-grid, .taxi-calc-fallback .tcf-grid.tcf-grid-2 { grid-template-columns:1fr 1fr; }
}


/* ===== FIX RISULTATI CALCOLATORE SU SMARTPHONE ===== */

@media screen and (max-width: 600px) {

    .taxi-calc-root {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        padding: 12px;
    }

    #prezzo-stimato,
    #prezzo-stimato .result-box {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    #prezzo-stimato .result-box {
        padding: 16px 12px;
    }

    #prezzo-stimato .price-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
        margin: 16px 0;
    }

    #prezzo-stimato .price-row .label {
        display: block;
        width: 100%;
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: left;
        font-size: 16px;
        line-height: 1.4;
    }

    #prezzo-stimato .price-row .value {
        display: block;
        width: 100%;
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: right;
        font-size: clamp(16px, 4.5vw, 22px);
        line-height: 1.4;
    }

    #prezzo-stimato .calc-footer {
        overflow-wrap: anywhere;
        line-height: 1.6;
    }
}
