/* Wrapper principale */
.kfo-wrapper {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #ffffff;
    border-radius: 22px;
    padding: 28px;
    max-width: 920px;
    margin: 30px auto;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.16);
    border: 1px solid #e2e8f0;
}

.kfo-title {
    margin: 0 0 20px 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.03em;
}

/* Messaggio successo */
.kfo-alert-success {
    padding: 10px 14px;
    border-radius: 12px;
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    color: #166534;
    font-size: 0.9rem;
    margin-bottom: 18px;
}

/* Sezioni */
.kfo-section {
    margin-bottom: 18px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.kfo-section-title {
    padding: 8px 14px;
    background: #0f172a;
    color: #f9fafb;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.kfo-section-body {
    padding: 14px 16px 16px 16px;
}

/* Grid helpers */
.kfo-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.kfo-row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 10px;
}

/* Field */
.kfo-field {
    display: flex;
    flex-direction: column;
}

.kfo-field label {
    font-size: 0.78rem;
    color: #475569;
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kfo-field input,
.kfo-field select,
.kfo-field textarea {
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 8px 10px;
    font-size: 0.9rem;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.kfo-field input:focus,
.kfo-field select:focus,
.kfo-field textarea:focus {
    border-color: #fb923c;
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.25);
    background: #fff7ed;
    outline: none;
}

/* Summary */
.kfo-summary {
    margin-top: 20px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f172a, #020617);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 10px 30px rgba(15,23,42,0.5);
}

.kfo-summary h3 {
    margin: 0 0 6px 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.kfo-summary span {
    font-variant-numeric: tabular-nums;
}

/* Azioni */
.kfo-actions {
    margin-top: 22px;
    text-align: right;
}

.kfo-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #fb923c, #f97316);
    color: #111827;
    box-shadow: 0 10px 25px rgba(248, 113, 113, 0.45);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.kfo-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(248, 113, 113, 0.55);
    filter: brightness(1.03);
}

.kfo-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 7px 18px rgba(248, 113, 113, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .kfo-wrapper {
        padding: 18px;
        margin: 16px;
    }

    .kfo-grid-3,
    .kfo-row-2 {
        grid-template-columns: 1fr;
    }
}
