/*
 * UI skin for the NLT Preventivo plugin.
 *
 * This stylesheet attempts to mirror the design of the Lovable "Auto Offer Navigator" demo.
 * It hides the WordPress theme header and footer, widens the container, adjusts the
 * typography and layout, and applies a modern card look to the form, detail panel
 * and results. The selectors target the classes output by the existing NLT Preventivo
 * shortcode so the business logic remains untouched.
 */

/* Hide the site header and footer so only the quoting tool remains visible */
#masthead,
#colophon {
    display: none !important;
}

/* Ensure the page takes up the full width and remove any theme padding */
body.page,
.ast-container,
.content-area {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Wrapper around the entire quoting tool */
.nlt-preventivo-wrapper {
    max-width: 1320px;
    margin: 0 auto 48px auto;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #14213d;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

/* Title at the top of the tool */
.nlt-preventivo-title {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    margin: 0 0 1.5rem;
    color: #16233b;
    font-weight: 900;
}

/* Main form card */
.nlt-preventivo-form {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    border: 1px solid #dde4f0;
    border-radius: 28px;
    padding: 28px 28px 24px;
    margin-bottom: 32px;
    box-shadow: 0 18px 50px rgba(21, 34, 59, 0.08);
}

/* Decorative gradient at the top of the form card */
.nlt-preventivo-form:before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 86px;
    background: linear-gradient(90deg, rgba(46, 109, 230, 0.08), rgba(79, 70, 229, 0.05));
    border-radius: 28px 28px 0 0;
    pointer-events: none;
}

.nlt-preventivo-form > * {
    position: relative;
    z-index: 1;
}

/* Grid layout for the form fields */
.nlt-preventivo-form-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

/* Reset min-width on field containers */
.nlt-preventivo-field {
    min-width: 0;
}

/* Styling for labels */
.nlt-preventivo-field label {
    display: block;
    font-size: 0.98rem;
    margin-bottom: 9px;
    font-weight: 800;
    color: #1a2740;
}

/* Shared styling for selects and inputs */
.nlt-preventivo-field select,
.nlt-preventivo-field input {
    display: block;
    width: 100% !important;
    height: 58px !important;
    line-height: 58px !important;
    padding: 0 48px 0 18px !important;
    border-radius: 16px !important;
    border: 1px solid #ccd6e4 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #1d2a44 !important;
    background: #fff !important;
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    min-height: 58px !important;
}

/* Stili aggiuntivi per i nuovi selettori (checkbox e slider) introdotti nella versione 3.3.2 */
.nlt-preventivo-field input[type="checkbox"] {
    width: auto !important;
    height: auto !important;
    margin-right: 8px;
    vertical-align: middle;
}
.nlt-preventivo-field input[type="range"] {
    width: 100% !important;
    height: 40px !important;
    padding: 0 !important;
    margin-top: 4px;
}
#nltp_commission_out {
    display: inline-block;
    margin-left: 8px;
    font-weight: 700;
    min-width: 32px;
}

/* Custom dropdown arrow on selects */
.nlt-preventivo-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%23546885' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 14px 14px !important;
    padding-right: 44px !important;
}

.nlt-preventivo-field select option {
    color: #16233b;
}

.nlt-preventivo-field select:focus,
.nlt-preventivo-field input:focus {
    outline: none;
    border-color: #4b77ff !important;
    box-shadow: 0 0 0 4px rgba(75, 119, 255, 0.14) !important;
}

.nlt-preventivo-field select:disabled,
.nlt-preventivo-field input:disabled {
    background: #eef3f9 !important;
    color: #6c7c95 !important;
}

/* Submit/reset buttons */
.nlt-preventivo-submit {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 4px;
}

.nlt-preventivo-submit button {
    border: none;
    background: linear-gradient(135deg, #2463eb, #1d4ed8);
    color: #fff;
    padding: 15px 28px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(36, 99, 235, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.nlt-preventivo-submit button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(36, 99, 235, 0.32);
}

/* Detail panel spacing */
.nlt-motornet-detail {
    margin-top: 22px;
}

/* Vehicle detail card */
.nlt-detail-card {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 22px;
    align-items: stretch;
    border-top: 1px solid #e6ecf4;
    padding-top: 22px;
}

.nlt-detail-image {
    min-height: 210px;
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(180deg, #edf3fb 0%, #e3ebf6 100%);
    border: 1px solid #d9e3ef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nlt-detail-image img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 210px;
    object-fit: contain;
    background: #fff;
}

.nlt-detail-text {
    background: #fff;
    border: 1px solid #e3e9f2;
    border-radius: 22px;
    padding: 20px 22px;
    box-shadow: 0 10px 30px rgba(21, 34, 59, 0.05);
}

.nlt-detail-title {
    font-size: 1.28rem;
    line-height: 1.15;
    margin-bottom: 6px;
    color: #14213d;
}

.nlt-detail-subtitle {
    font-size: 1rem;
    color: #4b5b77;
    font-weight: 600;
    margin-bottom: 12px;
}

.nlt-detail-price {
    font-size: 1.1rem;
    color: #20314f;
    margin-bottom: 14px;
}

.nlt-detail-specs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.nlt-detail-spec {
    padding: 14px 16px;
    border-radius: 16px;
    background: #f7f9fc;
    border: 1px solid #e2e9f2;
    color: #33435f;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nlt-detail-spec-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: #7a889d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Section titles and headings */
.nlt-preventivo-wrapper h3,
.nlt-preventivo-section-title {
    font-size: 2rem;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin: 18px 0 16px;
    color: #16233b;
    font-weight: 800;
}

/* Grid for the results cards */
.nlt-preventivo-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

/* Individual result card */
.nlt-preventivo-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    border-radius: 22px;
    padding: 20px;
    border: 1px solid #e2e9f2;
    box-shadow: 0 16px 40px rgba(21, 34, 59, 0.06);
}

.nlt-preventivo-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.nlt-preventivo-provider {
    font-weight: 900;
    font-size: 1.55rem;
    line-height: 1.05;
    color: #14213d;
    letter-spacing: -0.03em;
}

.nlt-preventivo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 7px 11px;
    border-radius: 999px;
    background: #f4f7fb;
    border: 1px solid #e8edf5;
    color: #40506e;
    white-space: nowrap;
}

/* Colored dots inside badges */
.nlt-preventivo-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}
.nlt-dot-green  { background: #22c55e; }
.nlt-dot-yellow { background: #f5c400; }
.nlt-dot-red    { background: #ef4444; }
.nlt-dot-blue   { background: #3b82f6; }

.nlt-preventivo-price {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    margin: 6px 0 12px;
    color: #10203b;
}

.nlt-preventivo-price span {
    font-size: 1rem;
    font-weight: 700;
    color: #66748b;
    letter-spacing: 0;
}

.nlt-preventivo-details {
    font-size: 1rem;
    color: #324159;
    font-weight: 700;
    line-height: 1.45;
}

.nlt-preventivo-details > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.nlt-preventivo-details > div:last-child span {
    display: inline-flex;
    align-items: center;
    padding: 8px 11px;
    border-radius: 999px;
    background: #f6f8fc;
    border: 1px solid #e7edf6;
    color: #4a5b79;
    font-size: 0.88rem;
    font-weight: 700;
}

.nlt-preventivo-footnote {
    font-size: 0.87rem;
    color: #66748b;
    margin-top: 14px;
    line-height: 1.45;
}

.nlt-preventivo-error {
    color: #d92d20;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 14px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .nlt-preventivo-form-row {
        grid-template-columns: 1fr 1fr;
    }
    .nlt-detail-card {
        grid-template-columns: 1fr;
    }
    .nlt-detail-specs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .nlt-preventivo-wrapper {
        margin-bottom: 36px;
    }
    .nlt-preventivo-form {
        padding: 22px 18px 20px;
        border-radius: 22px;
    }
    .nlt-preventivo-form-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .nlt-preventivo-title {
        font-size: 2rem;
    }
    .nlt-preventivo-field select,
    .nlt-preventivo-field input {
        height: 54px !important;
        line-height: 54px !important;
        font-size: 0.98rem !important;
    }
    .nlt-detail-image img,
    .nlt-detail-image {
        min-height: 190px;
    }
    .nlt-preventivo-provider {
        font-size: 1.35rem;
    }
    .nlt-preventivo-price {
        font-size: 1.8rem;
    }
    .nlt-detail-specs {
        grid-template-columns: 1fr;
    }
}