/* ─── Reset e base ──────────────────────────────────────────────────────── */

.bsb-form-wrap *,
.bsb-form-wrap *::before,
.bsb-form-wrap *::after {
    box-sizing: border-box;
}

.bsb-form-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 16px;
}


/* ─── Sezioni ────────────────────────────────────────────────────────────── */

.bsb-section {
    padding: 36px 0 28px;
    border-top: 1px solid #e0e0e0;
}

.bsb-section:first-child {
    border-top: none;
    padding-top: 0;
}

.bsb-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.bsb-section-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 24px;
}


/* ─── Grid campi ─────────────────────────────────────────────────────────── */

.bsb-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 28px;
    margin-bottom: 20px;
}

.bsb-row.bsb-row--full {
    grid-template-columns: 1fr;
}

@media (max-width: 600px) {
    .bsb-row {
        grid-template-columns: 1fr;
    }
}


/* ─── Campo singolo ──────────────────────────────────────────────────────── */

.bsb-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bsb-field label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bsb-field .bsb-badge-private {
    font-size: 11px;
    font-weight: 500;
    color: #888;
    background: #f0f0f0;
    border-radius: 4px;
    padding: 2px 7px;
    letter-spacing: 0.01em;
}

.bsb-field input,
.bsb-field select,
.bsb-field textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    color: #1a1a1a;
    background: #f7f7f7;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.bsb-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 36px;
    cursor: pointer;
}

.bsb-field textarea {
    resize: vertical;
    min-height: 90px;
    line-height: 1.5;
}

.bsb-field input:focus,
.bsb-field select:focus,
.bsb-field textarea:focus {
    border-color: #1a1a1a;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,26,26,0.07);
}

.bsb-field input.bsb-error,
.bsb-field select.bsb-error,
.bsb-field textarea.bsb-error {
    border-color: #d0021b;
    background: #fff8f8;
}

.bsb-field input::placeholder,
.bsb-field textarea::placeholder {
    color: #aaa;
}

.bsb-field .bsb-hint {
    font-size: 12px;
    color: #888;
    margin: 0;
}

.bsb-field .bsb-error-msg {
    font-size: 12px;
    color: #d0021b;
    display: none;
}

.bsb-field.has-error .bsb-error-msg {
    display: block;
}


/* ─── Upload fotografie ──────────────────────────────────────────────────── */

.bsb-upload-area {
    border: 2px dashed #c0c0c0;
    border-radius: 8px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafafa;
    position: relative;
}

.bsb-upload-area:hover,
.bsb-upload-area.dragover {
    border-color: #1a1a1a;
    background: #f3f3f3;
}

.bsb-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.bsb-upload-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    color: #999;
}

.bsb-upload-area p {
    margin: 0 0 4px;
    font-size: 14px;
    color: #444;
    font-weight: 500;
}

.bsb-upload-area span {
    font-size: 12px;
    color: #999;
}

.bsb-upload-btn {
    display: inline-block;
    margin-top: 14px;
    padding: 8px 20px;
    border: 1px solid #c0c0c0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    pointer-events: none;
}

.bsb-upload-area:hover .bsb-upload-btn {
    background: #f0f0f0;
    border-color: #aaa;
}

.bsb-upload-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.bsb-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #ddd;
    background: #eee;
    cursor: pointer;
    transition: border-color 0.15s;
}

.bsb-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bsb-preview-item.is-principale {
    border-color: #1a1a1a;
}

.bsb-preview-item.is-principale::after {
    content: 'Principale';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26,26,26,0.78);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    padding: 3px 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bsb-preview-item .bsb-remove-photo {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.bsb-preview-item .bsb-remove-photo:hover {
    background: rgba(208,2,27,0.85);
}

.bsb-foto-principale-hint {
    font-size: 12px;
    color: #666;
    margin: 8px 0 0;
}

.bsb-upload-error {
    font-size: 12px;
    color: #d0021b;
    margin-top: 8px;
    display: none;
}

.bsb-upload-error.visible {
    display: block;
}


/* ─── Dati segnalante ────────────────────────────────────────────────────── */

.bsb-section--segnalante {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 28px 28px 24px;
    border: 1px solid #e0e0e0;
    margin-top: 8px;
}

.bsb-section--segnalante .bsb-section-title {
    font-size: 18px;
}


/* ─── Messaggi globali ───────────────────────────────────────────────────── */

.bsb-notice {
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 24px;
    display: none;
}

.bsb-notice.visible {
    display: block;
}

.bsb-notice--success {
    background: #f0faf4;
    border: 1px solid #50c878;
    color: #1a6b3a;
}

.bsb-notice--error {
    background: #fff8f8;
    border: 1px solid #d0021b;
    color: #a00015;
}


/* ─── Disclaimer legale ──────────────────────────────────────────────────── */

.bsb-disclaimer {
    background: #fffbea;
    border: 1px solid #e8d96a;
    border-radius: 8px;
    padding: 24px 28px;
    margin-top: 8px;
}

.bsb-disclaimer-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.bsb-disclaimer-intro {
    font-size: 13px;
    color: #444;
    margin: 0 0 14px;
}

.bsb-disclaimer-list {
    margin: 0 0 20px;
    padding-left: 20px;
    list-style: disc;
}

.bsb-disclaimer-list li {
    font-size: 13px;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.5;
}

.bsb-disclaimer-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.bsb-disclaimer-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-top: 2px;
    accent-color: #1a1a1a;
    cursor: pointer;
}

.bsb-disclaimer-check label {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    cursor: pointer;
    line-height: 1.4;
}

.bsb-disclaimer-check.has-error label {
    color: #d0021b;
}


/* ─── Footer / bottoni ───────────────────────────────────────────────────── */

.bsb-form-footer {
    padding: 28px 0 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.bsb-cancel-btn {
    padding: 12px 28px;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #c0c0c0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.bsb-cancel-btn:hover {
    background: #f3f3f3;
    border-color: #aaa;
}

.bsb-submit-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #e8a000;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    letter-spacing: 0.01em;
}

.bsb-submit-btn:hover:not(:disabled) {
    background: #cf8e00;
}

.bsb-submit-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.bsb-submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.bsb-submit-icon {
    font-size: 15px;
    line-height: 1;
}

.bsb-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bsb-spin 0.7s linear infinite;
}

.bsb-submit-btn.loading .bsb-spinner {
    display: inline-block;
}

@keyframes bsb-spin {
    to { transform: rotate(360deg); }
}
