/* ── Configuratore STP ─────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&family=DM+Mono:wght@400;500&display=swap');

.cstp-wrap {
    --cstp-bg:        #f5f4f1;
    --cstp-surface:   #ffffff;
    --cstp-border:    #e2dfd8;
    --cstp-accent:    #1a1a1a;
    --cstp-muted:     #8a8680;
    --cstp-success:   #2d6a4f;
    --cstp-success-bg:#d8f3dc;
    --cstp-error-bg:  #ffe8e8;
    --cstp-error:     #c0392b;

    --black: #373737;
    --black-rgb: 55 55 55;
    --white: #ffffff;
    --white-rgb: 255 255 255;
    --red: #CA4838;
    --red-rgb: 202 72 56;
    --grey: #ECECEC;
    --grey-rgb: 236 236 236;


    --cstp-radius:    10px;
    --cstp-font:      'Outfit', sans-serif;
    --cstp-mono:      'DM Mono', monospace;
    --cstp-shadow:    0 2px 12px rgba(0,0,0,0.07);

    font-family: var(--cstp-font);
    background: var(--grey);
    border-radius: 1rem; padding: 1.5rem; max-width: 100%;
}

/* ── Layout ── */
.cstp-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.cstp-group {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.cstp-hidden {
    display: none !important;
}

/* ── Label ── */
.cstp-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cstp-muted);
}

/* ── Select wrapper (freccia custom) ── */
.cstp-select-wrap {
    position: relative;
}

.cstp-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 var(--cstp-accent);
    pointer-events: none;
    transition: border-top-color 0.2s;
}

.cstp-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: var(--cstp-surface);
    border: 1.5px solid var(--cstp-border);
    border-radius: var(--cstp-radius);
    padding: 11px 38px 11px 14px;
    font-family: var(--cstp-font);
    font-size: 14px;
    font-weight: 500;
    color: var(--cstp-accent);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.cstp-select:focus {
    border-color: var(--cstp-accent);
    box-shadow: 0 0 0 3px rgba(26,26,26,0.08);
}

.cstp-select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── Risultato ── */
.cstp-result {
    margin-top: 18px;
    background: var(--cstp-success-bg);
    border: 1.5px solid #95d5b2;
    border-radius: var(--cstp-radius);
    padding: 12px 16px;
    animation: cstp-fadein 0.3s ease;
}

.cstp-result-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cstp-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--cstp-success);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    flex-shrink: 0;
}

.cstp-result-text {
    font-family: var(--cstp-mono);
    font-size: 13px;
    color: var(--cstp-success);
    word-break: break-all;
}

/* ── Errore ── */
.cstp-error {
    margin-top: 14px;
    background: var(--cstp-error-bg);
    border: 1.5px solid #f5b7b1;
    border-radius: var(--cstp-radius);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--cstp-error);
    animation: cstp-fadein 0.3s ease;
}

/* ── Debug box (solo admin) ── */
.cstp-debug {
    margin-top: 18px;
    background: #1a1a2e;
    border: 1.5px solid #2d2d4e;
    border-radius: var(--cstp-radius);
    padding: 14px 16px;
    animation: cstp-fadein 0.3s ease;
}

.cstp-debug-title {
    font-family: var(--cstp-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: #7c7ca8;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.cstp-debug-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--cstp-mono);
    font-size: 12px;
}

.cstp-debug-table td {
    padding: 4px 8px 4px 0;
    vertical-align: top;
    color: #a0a0c8;
}

.cstp-debug-table td:first-child {
    color: #6a6a8a;
    white-space: nowrap;
    padding-right: 16px;
    width: 130px;
}

.cstp-debug-table td:last-child {
    color: #c8f7c5;
    word-break: break-all;
}

.cstp-debug-table a {
    color: #7fdbca !important;
    text-decoration: underline;
}
@keyframes cstp-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ── Button ── */
.link { margin-top: 1rem; }



/* ── Responsive ── */
@media (max-width: 520px) {
    .cstp-wrap { padding: 20px 16px; }
    .cstp-row  { flex-direction: column; gap: 12px; }
    .cstp-group { min-width: unset; min-width: calc((100% / 3) - 16px; }
}



