/* PTZ Calculator 2026 — Design sobre Vefalys */

/* ---- Neutralise Select2 / overrides thème ---- */
#ptz-calculator select,
#ptz-calculator input,
#ptz-calculator .ptz-input,
#ptz-calculator .ptz-select,
#ptz-calculator .select2-container,
#ptz-calculator .select2-selection,
#ptz-calculator .dropdown {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
/* Masque le widget Select2 s'il est injecté dans notre plugin */
#ptz-calculator + .select2-container,
#ptz-calculator .select2-container--default .select2-selection--single {
    display: none !important;
}

#ptz-calculator {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 540px;
    margin: 0 auto;
    padding: 24px 20px;
    background: #fff;
    color: #1a1a1a;
    box-sizing: border-box;
}

#ptz-calculator * {
    box-sizing: border-box;
}

/* ---- Titre page ---- */
.ptz-page-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.ptz-page-sub {
    font-size: 12px;
    color: #999;
    margin: 0 0 28px;
    font-style: italic;
}

/* ---- Chaque champ ---- */
.ptz-field {
    margin-bottom: 20px;
}

.ptz-label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 400;
}

/* ---- Inputs & selects ---- */
#ptz-calculator .ptz-input,
#ptz-calculator .ptz-select,
#ptz-calculator select,
#ptz-calculator input[type="text"],
#ptz-calculator input[type="number"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 52px !important;
    padding: 14px 14px !important;
    border: 1.5px solid #d0d0d0 !important;
    border-radius: 8px !important;
    font-size: 16px !important; /* 16px évite le zoom auto sur iOS */
    line-height: 1.4 !important;
    color: #1a1a1a !important;
    background: #fff !important;
    outline: none !important;
    transition: border-color .15s !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
}

#ptz-calculator .ptz-input:focus,
#ptz-calculator .ptz-select:focus,
#ptz-calculator select:focus,
#ptz-calculator input:focus {
    border-color: #3a7d5c !important;
    box-shadow: none !important;
}

#ptz-calculator .ptz-input::placeholder {
    color: #bbb;
}

/* Select : flèche custom */
#ptz-calculator .ptz-select-wrap {
    position: relative;
    width: 100% !important;
}

#ptz-calculator .ptz-select-wrap::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #888;
    pointer-events: none;
    z-index: 1;
}

#ptz-calculator .ptz-select-wrap .ptz-select,
#ptz-calculator .ptz-select-wrap select {
    padding-right: 42px !important;
}

/* ---- Zone badge (lecture seule) ---- */
.ptz-zone-box {
    padding: 14px;
    border: 1.5px solid #d0d0d0;
    border-radius: 8px;
    font-size: 15px;
    color: #1a1a1a;
    background: #fff;
    min-height: 50px;
}

.ptz-zone-box.filled {
    color: #1a1a1a;
}

/* ---- Ville : champ + bouton inline ---- */
#ptz-calculator .ptz-city-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

#ptz-calculator .ptz-city-row .ptz-input {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: auto !important;
}

#ptz-calculator .ptz-btn-search {
    flex: 0 0 auto;
    padding: 0 20px;
    background: #3a7d5c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    min-height: 52px;
    display: flex;
    align-items: center;
}

#ptz-calculator .ptz-btn-search:active {
    background: #2d6348;
}

/* ---- Warning zone non trouvée ---- */
.ptz-zone-note {
    font-size: 12px;
    color: #a07800;
    margin-top: 6px;
    display: none;
}

/* ---- Alert plafond dépassé ---- */
.ptz-alert {
    border: 1.5px solid #f0c040;
    background: #fffbee;
    border-radius: 8px;
    padding: 14px;
    font-size: 13.5px;
    color: #5a4200;
    line-height: 1.6;
    margin-bottom: 20px;
    display: none;
}

.ptz-alert strong {
    color: #3a7d5c;
}

/* ---- Bouton calculer ---- */
.ptz-btn-calc {
    display: block;
    width: 100%;
    padding: 16px;
    background: #3a7d5c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-top: 8px;
}

.ptz-btn-calc:active {
    background: #2d6348;
}

/* ---- Loader ---- */
.ptz-loader {
    text-align: center;
    padding: 24px 0;
    font-size: 14px;
    color: #888;
    display: none;
}

/* ---- Résultats ---- */
.ptz-results {
    margin-top: 28px;
    display: none;
}

/* Bloc montant principal */
.ptz-hero {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 24px 20px;
    text-align: center;
    margin-bottom: 12px;
}

.ptz-hero-label {
    font-size: 13px;
    color: #888;
    margin: 0 0 8px;
}

.ptz-hero-amount {
    font-size: 52px;
    font-weight: 800;
    color: #3a7d5c;
    margin: 0;
    letter-spacing: -1px;
    line-height: 1;
}

/* Cartes détail */
.ptz-card {
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
}

.ptz-card-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.ptz-card-value {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Non éligible */
.ptz-ineligible {
    border: 1.5px solid #f0c040;
    background: #fffbee;
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
    color: #5a4200;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* Reset */
.ptz-btn-reset {
    display: block;
    width: 100%;
    padding: 13px;
    background: transparent;
    border: 1.5px solid #3a7d5c;
    color: #3a7d5c;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-top: 14px;
}

.ptz-legal {
    font-size: 11px;
    color: #bbb;
    text-align: center;
    margin-top: 14px;
    line-height: 1.6;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    #ptz-calculator {
        padding: 20px 16px;
    }
    #ptz-calculator .ptz-hero-amount {
        font-size: 44px;
    }
    /* Forcer les selects à afficher le texte complet sur petits écrans */
    #ptz-calculator select,
    #ptz-calculator .ptz-select {
        font-size: 16px !important;
        min-height: 54px !important;
        padding-top: 16px !important;
        padding-bottom: 16px !important;
    }
}
