/* ─── Reset & base ─────────────────────────────────────────────────────────── */
.ict-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #111;
    box-sizing: border-box;
}

.ict-content {
    background: #fff;
    border-radius: 14px;
    padding: 36px 40px;
    box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.06);
}

/* ─── Titolo ────────────────────────────────────────────────────────────────── */
.ict-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: #111;
}

.ict-subtitle {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 28px;
}

/* ─── Consenso ──────────────────────────────────────────────────────────────── */
.ict-consent-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f7f7f7;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 24px;
}

.ict-consent-box input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #111;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.ict-consent-box label {
    font-size: 0.875rem;
    color: #555;
    line-height: 1.6;
    cursor: pointer;
    margin: 0;
}

.ict-consent-box label strong {
    color: #111;
    font-weight: 600;
}

.ict-consent-box.ict-consent-error {
    border-color: #e53e3e;
    background: #fff5f5;
    animation: ict-shake 0.35s ease;
}

@keyframes ict-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ─── Drag & drop zone ──────────────────────────────────────────────────────── */
.ict-drop-zone {
    position: relative;
    border: 1.5px dashed #d0d0d0;
    border-radius: 12px;
    padding: 36px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    text-align: center;
    margin-bottom: 24px;
}

.ict-drop-zone:hover,
.ict-drop-zone.ict-drag-over {
    background: #f9f9f9;
    border-color: #999;
}

.ict-drop-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    margin-bottom: 4px;
}

.ict-drop-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #222;
    margin: 0;
}

.ict-drop-hint {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
}

.ict-drop-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 220px;
    margin: 4px 0;
}

.ict-drop-divider hr {
    flex: 1;
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 0;
}

.ict-drop-divider span {
    font-size: 0.78rem;
    color: #bbb;
}

.ict-btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .15s;
}

.ict-btn-upload:hover { opacity: 0.82; }



/* ─── Feature strip ─────────────────────────────────────────────────────────── */
.ict-feature-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.ict-feat {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f7f7f7;
    border-radius: 10px;
    padding: 12px 14px;
}

.ict-feat svg {
    color: #555;
    flex-shrink: 0;
    margin-top: 1px;
}

.ict-feat div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ict-feat strong {
    font-size: 0.82rem;
    font-weight: 600;
    color: #111;
}

.ict-feat span {
    font-size: 0.78rem;
    color: #888;
    line-height: 1.4;
}

/* ─── Messaggi (nascosti di default) ────────────────────────────────────────── */
#ict-error-message,
#ict-success-message,
#ict-upload-loader {
    display: none;
}

.ict-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 0 0 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

.ict-error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #fed7d7;
}

.ict-success {
    background: #f0fff4;
    color: #276749;
    border: 1px solid #c6f6d5;
}

/* ─── Loader ────────────────────────────────────────────────────────────────── */
.ict-loader {
    text-align: center;
    padding: 32px;
    color: #888;
    font-size: 0.875rem;
}

.ict-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: #111;
    border-radius: 50%;
    animation: ict-spin 0.8s linear infinite;
    margin: 0 auto 14px;
}

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

/* ─── Canvas ────────────────────────────────────────────────────────────────── */
.ict-canvas-wrapper {
    position: relative;
    margin: 0 0 24px;
}

.ict-canvas-container {
    width: 100%;
    min-height: 280px;
    border: 1.5px dashed #d0d0d0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    overflow: hidden;
    box-sizing: border-box;
}

.ict-canvas-container.has-image {
    border-style: solid;
    border-color: #e0e0e0;
    background: #fff;
    padding: 16px;
}

#ict-image-canvas {
    max-width: 100%;
    display: none;
    border-radius: 6px;
}

.ict-canvas-container.has-image #ict-image-canvas {
    display: block;
}

.ict-canvas-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #bbb;
    font-size: 0.875rem;
}

.ict-canvas-overlay svg { opacity: .6; }

.ict-canvas-container.has-image .ict-canvas-overlay {
    display: none;
}

/* ─── Toolbar ───────────────────────────────────────────────────────────────── */
.ict-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 24px;
}

.ict-tool-button,
.ict-secondary-button,
.ict-primary-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .12s, opacity .12s, transform .1s;
    border: 1px solid #ddd;
    background: #fff;
    color: #222;
    white-space: nowrap;
}

.ict-tool-button:hover:not(:disabled) { background: #f5f5f5; }
.ict-tool-button.active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.ict-secondary-button { background: #f5f5f5; border-color: #e0e0e0; color: #444; }
.ict-secondary-button:hover:not(:disabled) { background: #ebebeb; }

.ict-primary-button { background: #111; color: #fff; border-color: #111; }
.ict-primary-button:hover:not(:disabled) { opacity: .82; }

.ict-tool-button:disabled,
.ict-secondary-button:disabled,
.ict-primary-button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* ─── Slider intensità ──────────────────────────────────────────────────────── */
.ict-intensity-slider { flex: 1; min-width: 180px; }

.ict-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ict-slider-container > span:first-child {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
}

#ict-intensity-slider {
    flex: 1;
    accent-color: #111;
    height: 4px;
    cursor: pointer;
}

.ict-slider-value {
    font-size: 0.8rem;
    font-weight: 600;
    background: #111;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 32px;
    text-align: center;
}

/* ─── Istruzioni ────────────────────────────────────────────────────────────── */
.ict-zoom-instructions {
    background: #f7f7f7;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 8px;
}

.ict-zoom-instructions strong {
    font-size: 0.82rem;
    font-weight: 600;
    color: #111;
    display: block;
    margin-bottom: 10px;
}

.ict-zoom-instructions ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ict-zoom-instructions li {
    display: flex;
    gap: 10px;
    font-size: 0.82rem;
    color: #666;
}

.ict-zoom-instructions li span {
    font-weight: 600;
    color: #333;
    min-width: 60px;
}

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.ict-footer {
    text-align: center;
    padding-top: 24px;
    margin-top: 32px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.78rem;
    color: #bbb;
}

/* ─── reCAPTCHA spacing ─────────────────────────────────────────────────────── */
.ict-recaptcha-container { margin-bottom: 20px; }

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .ict-content { padding: 24px 20px; }

    .ict-feature-strip { grid-template-columns: 1fr; }

    .ict-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ict-toolbar button,
    .ict-intensity-slider {
        width: 100%;
    }

    .ict-slider-container { flex-wrap: nowrap; }
}
